How to set line color which in the xychart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
JSTART
Posts: 4
Joined: Tue Apr 13, 2004 8:32 am

How to set line color which in the xychart

Post by JSTART » Thu May 13, 2004 5:20 am

How to set line color which in the xychart

I hava three line in the xychart , how can i change line default color

astenwick
Posts: 13
Joined: Tue Apr 13, 2004 8:03 pm
Location: Seattle

Post by astenwick » Fri May 14, 2004 12:34 am

If each of your lines is a seperate series and you are using the XYLineAndShapeRenderer, use this method:

Code: Select all

    
public void setSeriesPaint(int series, Paint paint) {
        setSeriesPaint(series, paint, true);
    }
and set the paint for each of your series like so:

Code: Select all

renderer.setSeriesPaint(0, ChartColor.yellow);
renderer.setSeriesPaint(1, ChartColor.blue);
renderer.setSeriesPaint(2, ChartColor.red);

Locked