JFreeChart:在缩放图表时添加并同步一个滚动条(Eclipse插件/ SWT) [英] JFreeChart: Add and sync a srollbar when zooming a chart (Eclipse plugin / SWT)
问题描述
我正在使用JFreeChart库在Eclipse视图中绘制一些东西,目前我的视图初始化代码如下所示:
I am using JFreeChart library to plot something in an Eclipse view and currently my code for view initialization looks as follows:
@Override
public void createPartControl(Composite parent)
{
JFreeChart chart = null;
// Created via different object
chart = graph.createLineChart("Test Graph", "x", "y");
ChartComposite frame = new ChartComposite(parent, SWT.NONE, chart, true);
frame.setRangeZoomable(false);
parent.layout(true);
}
当用户放大时,我想添加滚动到我的图形,但是我发现的所有例子(在演示包中,这里和其他来源)基于Swing处理JPanes和ChartPanels。
I wanted to add scrolling to my graph when the user zooms in, but so far all the examples that I found (in the demo package, here, and other sources) are based on Swing dealing with JPanes and ChartPanels.
如何在 createPartControl()
我的视图功能,我只有一个复合
。是否可以在SWT中进行,或者应该将SWT与SWING或AWT混合使用吗?
How can I achieve the same in the createPartControl()
function of my view where I have only a Composite
. Is it possible to do it in SWT only or should I mix (need to figure out how) SWT with SWING or AWT?
谢谢
推荐答案
您可以查看 SlidingXYDataset
,提到这里,或者分页方式显示此处。
You might look at SlidingXYDataset
, mentioned here, or the paging approach shown here.
这篇关于JFreeChart:在缩放图表时添加并同步一个滚动条(Eclipse插件/ SWT)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!