change axis color and line color on a XYLineChart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
marcopolo
Posts: 2
Joined: Sun Feb 06, 2005 8:59 pm

change axis color and line color on a XYLineChart

Post by marcopolo » Sun Feb 06, 2005 9:09 pm

Hello,
i wonder to know how can we choose the color of the axis and how to change the color of the line we draw in a graph XYLineChart

thanks a lot

oacis
Posts: 101
Joined: Fri Jan 07, 2005 5:57 am
Location: Australia, Sydney

Post by oacis » Mon Feb 07, 2005 12:38 am

See point 6 of the FAQ
6. I want to set my own colors for each series in my chart. How do I do that?

for changing the axis colours, have a look at the javadocs for

Code: Select all

org.jfree.chart.axis.Axis
org.jfree.chart.axis.CategoryAxis
org.jfree.chart.axis.ValueAxis
and their associated subclasses.

You will need to have a look at the methods:

Code: Select all

setTickLabelPaint
setTickMarkPaint
setAxisLinePaint
setLabelPaint
in general their usage is

Code: Select all

set...Paint(new Color(R, G, B, A))
for Red, Green, Blue and Alpha (transparency) values as int. The Alpha value is optional

Locked