Forum - Info Center - Eltima Software

Eltima Help Center => The rest of our products & other questions => Topic started by: jasper on July 24, 2013, 08:15:00 AM

Title: Java Chart Designer API: Setting the color of the bars or lines
Post by: jasper on July 24, 2013, 08:15:00 AM
Hello NG,
I'm using the Java Chart Designer API for my Java Servlets and it 's important for me to set the color of the different bars and lines in the chart.

Can anybody help me?

Regard

Jasper
Title: Re: Java Chart Designer API: Setting the color of the bars or lines
Post by: James Foster on July 24, 2013, 04:38:40 PM
Hello Jasper,
I have replied you by email. If you haven't received it please find the quotation of my reply below.
Quote
Any component of the chart has its own attribute (color or gradient).

For example you can change the color of the column using the following code:

SeriesModel m = chart.getSeriesModel(1);  // SeriesModel of the first column

m.getGradientModel().setColor1(Color.BLUE));

Here you can also change the second color of gradient, set the number of cycles and set the direction of gradient.

Thank you.