1

我希望在 JFreeChart 中获得以下坐标。

我尝试使用

chartPanel.getScreenDataArea()

但是,这不是我想要的区域。

返回的矩形在我希望拥有的区域之外。

我希望拥有的坐标被标记为??? 在绿色。

替代文字 http://sites.google.com/site/yanchengcheok/Home/coordinate-problem-small.png

(放大版)

替代文字 http://sites.google.com/site/yanchengcheok/Home/coordinate-problem-big.png

4

2 回答 2

1

这是问题的解决方案。

/* Try to get correct main chart area. */
final Rectangle2D _plotArea = chartPanel.getChartRenderingInfo().getPlotInfo().getSubplotInfo(0).getDataArea();
于 2010-02-08T18:55:04.200 回答
0

一旦您可以获得图表的轴项,就有一些方法可以将图表和 AWT/Swing 坐标从一个转换为另一个。

double ValueAxis.java2DToValue(double)double ValueAxis.valueToJava2D(double)

于 2010-02-02T04:02:06.647 回答