*/
public boolean render(final GC gc, final Rectangle dataArea,
final int index, final PlotRenderingInfo info,
final CrosshairState cstate) {
final XYDataset dataset = this.getDataset(index);
if (DatasetUtilities.isEmptyOrNull(dataset)) {
return false;
}
final ValueAxis xAxis = this.getDomainAxisForDataset(index);
final ValueAxis yAxis = this.getRangeAxisForDataset(index);
XYItemRenderer renderer = this.getRenderer(index);
if (renderer == null) {
renderer = this.getRenderer();
}
// assert renderer != null : "Renderer is null";
final XYItemRendererState state = renderer.initialise(gc, dataArea,
this, dataset, info);
final int passCount = renderer.getPassCount();
final SeriesRenderingOrder seriesOrder = this.getSeriesRenderingOrder();
if (seriesOrder == SeriesRenderingOrder.REVERSE) {
// render series in reverse order
for (int pass = 0; pass < passCount; pass++) {
final int seriesCount = dataset.getSeriesCount();
for (int series = seriesCount - 1; series >= 0; series--) {
final int itemCount = dataset.getItemCount(series);
for (int item = 0; item < itemCount; item++) {
renderer.drawItem(gc, state, dataArea, info, this,
xAxis, yAxis, dataset, series, item, cstate,
pass);
}
}
}
} else {
// render series in forward order
for (int pass = 0; pass < passCount; pass++) {
final int seriesCount = dataset.getSeriesCount();
for (int series = 0; series < seriesCount; series++) {
final int itemCount = dataset.getItemCount(series);
for (int item = 0; item < itemCount; item++) {
renderer.drawItem(gc, state, dataArea, info, this,
xAxis, yAxis, dataset, series, item, cstate,
pass);
}