Dashed Line chart in Jfreechart

You would be better off asking this on the jfreechart forums.

Have a look at

StandardXYItemRenderer.setStroke().

I assume that you are using this renderer for your line plot.
 
Quote from krishna_arava:

Hi

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

thanks in advance

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.
 
Quote from krishna_arava:

Hi,

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

thanks,
krishna

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.
 
Quote from dcraig:

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.

Hi dcraig,

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

thanks in advance
krishna
 
Back
Top