Changing the thickness of the line in Linechart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
dmou1

Changing the thickness of the line in Linechart

Post by dmou1 » Thu Mar 18, 2004 4:48 pm

Hi,
I am creating a dataset with X and Y values and creating a LineChart. Is there any way to change the thickness of the line in the line chart? The line that i get presently is very thick. Is there some method that I can use in the XYPlot or some other class?
Basically i want to cutomize the LineChart ....what would be the best way to do it?
thanks,
dmou1

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Tue Mar 23, 2004 11:17 am

You can use plot.getRenderer().setSeriesStroke(...).
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Guest

Post by Guest » Fri Sep 09, 2005 4:55 am

Hi David,

I have tried to use the above code, but I get the error "void cannot be dereferenced".

Is there another way to set the stroke?

christopher.loerken
Posts: 16
Joined: Wed Aug 31, 2005 4:25 pm

Post by christopher.loerken » Fri Sep 09, 2005 11:51 am

Actually, if you get that reply, you've probably made a mistake...
It would help if you post the code that you run...

Harry Plotter ;-)
Posts: 12
Joined: Thu Aug 04, 2005 2:56 pm
Location: Oldenburg - Germany

Post by Harry Plotter ;-) » Fri Sep 09, 2005 11:55 am

try this:

Code: Select all

this.xyplot.getRenderer(1).setSeriesStroke(0,
				new BasicStroke(2.0f));
for me that works ...

Guest

Post by Guest » Wed Sep 21, 2005 10:01 am

If you want to set the line thickness for all series, use the following code...
thePlot.getRenderer(0).setStroke(new BasicStroke(2.0f));

Locked