0

我正在尝试在我的情节的特定区域计算每个系列点的计数。该图由网格(框)组成,我想知道每个框中的每个系列点的计数。我想获得类似的信息(网格 1 有 2 系列 1、0 系列 2、3 系列 3、4 系列 5 等)非常感谢任何帮助。

4

1 回答 1

0

当您拥有 XYItems 时,您可以获得每个项目的边界:

final Collection<ChartEntity> entities =   
  chartpanel.getChartRenderingInfo().getEntityCollection().getEntities();
for (final ChartEntity e : entities) {
  if (e instanceof XYItemEntity) {
    final XYItemEntity xyItem = (XYItemEntity) e;
    final int index = xyItem.getItem();
    final int series = xyItem.getSeriesIndex();
    Rectangle2D r = e.getArea().getBounds2D();
    checkPosition(r); // here you can check if the coordinates are inside your "box"
  }
}
于 2011-07-14T19:32:44.290 回答