Dashed Line chart in Jfreechart

Discussion in 'Trading Software' started by krishna_arava, May 10, 2005.

  1. Hi,

    how to draw dashed line chart in JFreeChart.

    thanks in advance,
  2. You would be better off asking this on the jfreechart forums.

    Have a look at


    I assume that you are using this renderer for your line plot.
  3. Hi

    I am talking about how to draw dashed lines in a line chart using JFreeChart but not XYLine chart.

    thanks in advance
  4. Yes, so am I. From memory, there are getRenderer() and setRenderer() methods for a plot. You will probably need to get hold of the rendererer and do a setStroke(). If this doesn't work, you will need to create your own renderer possibly (and most easily) by subclassing one of the standard renderers provided.

    The type of plot you need for stock chart type charts is an XYPlot.
  5. Hi,

    thanks for your quick response.
    I am using JFreeChart version 0.9.4, could please help the same with this version

  6. No, not really. That is a very, very old version. I'm using 0.9.20. I strongly suggest that you get hold of a more recent release. Also read the JavaDoc for BasicStroke in Java2D. It should do what you want.
  7. Hi dcraig,

    Is it possible to plot dots only excluding the lines in the chart.

    thanks in advance