0

プロットの特定の領域で各シリーズ ポイントの数を取得しようとしています。プロットはグリッド (ボックス) で構成されており、これらのボックスのそれぞれに存在する各シリーズ ポイントの数を知りたいです。次のような情報を取得したい (グリッド 1 にはシリーズ 1 の 2、シリーズ 2 の 0、シリーズ 3 の 3、シリーズ 5 の 4 など) どんな助けも大歓迎です。

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 に答える