custom gridbands paint

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
michela.montano
Posts: 4
Joined: Tue Sep 09, 2014 2:57 pm
antibot: No, of course not.

custom gridbands paint

Post by michela.montano » Tue Sep 09, 2014 3:05 pm

Hi all,
I'm using jfreechart to render a linechart diagram. I need to show bands in background, according to some pre-defined levels (range axis is defined as symbol axis).
E.g. band in range 1-2 must be green,band in range 2-6 must be yellow and so on
Maybe there's a way to customize the gridbands (now appearing ad alternate)?
Thank you,
regards,
Michela

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

Re: custom gridbands paint

Post by david.gilbert » Tue Sep 09, 2014 3:32 pm

You can use one of the addRangeMarker() methods:

http://www.jfree.org/jfreechart/api/jav ... ot.Marker-

The marker type you want is IntervalMarker.
David Gilbert
JFreeChart Project Leader

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

michela.montano
Posts: 4
Joined: Tue Sep 09, 2014 2:57 pm
antibot: No, of course not.

Re: custom gridbands paint

Post by michela.montano » Wed Sep 10, 2014 7:14 am

Thank you, it works perfectly!
regards,
Michela

Locked