JFreeChart在传递的java点之间适当缩放行为

时间:2013-09-11 13:34:59

标签: java charts jfreechart

假设我有一个 JFreeChart 的折线图,点(0,0)(3,3)。因此显示了从(0,0)到(3,3)的线。但是,当我缩放 X轴以便查看 x = 1 x = 2 之间的数据时,不显示数据(无线) 。

在两种情况下,我遇到了问题:

JFreeChart chart = org.jfree.chart.ChartFactory.createTimeSeriesChart("Example",
                "", "test", null, false, true, false);

和for:

JFreeChart chart = org.jfree.chart.ChartFactory.createXYStepChart
                    ("Example", "", "test", null,PlotOrientation.VERTICAL, true, true, false);

然而,在第二个另外我得到以下例外:

Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Requires xLow < xHigh.
    at org.jfree.chart.renderer.RendererUtilities.findLiveItemsLowerBound(RendererUtilities.java:76)
    at org.jfree.chart.renderer.RendererUtilities.findLiveItems(RendererUtilities.java:261)
    at org.jfree.chart.plot.XYPlot.render(XYPlot.java:3845)
    at org.jfree.chart.plot.XYPlot.draw(XYPlot.java:3389)
    at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1237)
    at org.jfree.chart.ChartPanel.paintComponent(ChartPanel.java:1677)

主要问题是:

即使我在'传递数据点'之间缩放,如何设置渲染器以查看数据(线)?

0 个答案:

没有答案