#1046 XYStepRenderer does not show shapes

closed-wont-fix
nobody
None
5
2011-10-10
2011-08-06
Geoffrey De Smet
No

XYStepRenderer extends XYLineAndShapeRenderer, but it doesn't support shapes:

This code doesn't show nothing:

XYSeriesCollection seriesCollection = new XYSeriesCollection();
seriesCollection.addSeries(series);
plot.setDataset(seriesIndex, seriesCollection);
XYStepRenderer renderer = new XYStepRenderer();
if (statisticPointList.size() <= 5) {
// There is only one or a few points (so likely construction heuristics benchmark), so make it clearly visible
java.awt.geom.Ellipse2D.Double dot = new java.awt.geom.Ellipse2D.Double(-4D, -4D, 8D, 8D);
renderer.setSeriesShape(0, dot);
renderer.setSeriesShapesVisible(0, true);
}
plot.setRenderer(seriesIndex, renderer);

Discussion

  • It's clear what's going on though: drawItem(...) never does
    getItemShapeVisible() or any shape drawing code like it's parent.

     
  • Martin Höller
    Martin Höller
    2011-10-10

    • status: open --> closed-wont-fix
     
  • Martin Höller
    Martin Höller
    2011-10-10

    This renderer is not meant to draw any shapes, as the JavaDoc says:
    "This class draws lines between data points, only allowing horizontal or vertical lines (steps)."

    The only problem with this renderer is, that it extends XYLineAndShapeRenderer and thus provides methods that are useless.