How Line Style dotted, dashed, solid?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Rahan
Posts: 12
Joined: Fri Jul 08, 2005 3:30 pm

How Line Style dotted, dashed, solid?

Post by Rahan » Tue Jul 22, 2008 3:12 pm

Hi

i have a Timeserieschart and use jfreechart 1.0.9. I want change the line style.

i know i can choose the color with like

Code: Select all

renderer.setSeriesPaint(series, Color.green);
and the thickness of the line like

Code: Select all

renderer.setSeriesStroke(series, new BasicStroke(2));
but i dont know how can i choose the line style
to dotted or dashed

skunk
Posts: 1087
Joined: Thu Jun 02, 2005 10:14 pm
Location: Brisbane, Australia

Post by skunk » Tue Jul 22, 2008 5:49 pm

Look at some of the other constructors for java.awt.BasicStroke

Rahan
Posts: 12
Joined: Fri Jul 08, 2005 3:30 pm

Post by Rahan » Wed Jul 23, 2008 7:59 am

Look at some of the other constructors for java.awt.BasicStroke
Sorry, but i look and dont understand. Image
Maybe you can give me an example?

paradoxoff
Posts: 1634
Joined: Sat Feb 17, 2007 1:51 pm

Post by paradoxoff » Wed Jul 23, 2008 12:45 pm

Here is an example that should get you started:
http://www.java2s.com/Code/Java/2D-Grap ... stroke.htm

Locked