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);
}
我想在用户放大时向我的图表添加滚动,但到目前为止我找到的所有示例(在演示包中,here 和其他来源)基于 Swing 处理 JPanes 和 ChartPanel.
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.
如何在我只有一个 Composite
的视图的 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
,在此处提到a>,或此处所示的分页方法.
You might look at SlidingXYDataset
, mentioned here, or the paging approach shown here.
这篇关于JFreeChart:缩放图表时添加和同步滚动条(Eclipse 插件/SWT)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!