Search code examples
javaswingjfreechart

How to hide points in XY Step Area Chart?


How can I hide the points in an XY Step Area Chart. The points are highlighted in the picture.

StepAreaChart pointers


Solution

  • Among the possible approaches:

    • Ask the XYStepAreaRenderer to make the shapes invisible:

      // shapes      
      final XYStepAreaRenderer r = (XYStepAreaRenderer) plot.getRenderer();
      r.setShapesVisible(false);
      
    • Specify XYStepAreaRenderer.AREA (area only) for the type in a custom factory method, as outlined here for a related renderer.

      XYItemRenderer r = new XYStepAreaRenderer(XYStepAreaRenderer.AREA,…);
      

    Shapes not visible: after

    Shapes visible: before