shift the X Axis

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
saby

shift the X Axis

Post by saby » Mon Jul 29, 2002 7:37 am

Hi All,
Wd like to know if there is a way I can superpose a colored line (probably for benchmarking purposes) on the graph. Or has anybody used any other technique for comparsion against a standard , e.g. shading, coloring, etc.

Any help wd be greatly appreciated.

Cheers,

saby.

David Gilbert

Re: shift the X Axis

Post by David Gilbert » Mon Jul 29, 2002 9:32 am

Hi Saby,

In the CategoryPlot class there is a method addRangeMarker(...). This lets you add one or more markers (usually represented as lines) to a plot.

For the XYPlot class, there are methods:

addHorizontalLine(...)
addVerticalLine(...)

I plan to change these methods (sometime) to addDomainMarker(...) and addRangeMarker(...) to make them consistent with the CategoryPlot class.

One other option (only implemented for the HorizontalNumberAxis at present) is to add a band to the axis that displays various ranges in different colors. Take a look at the setMarkerBand(...) method in the HorizontalNumberAxis class, and also the HorizontalBarChartDemo class for an example of this.

Regards,

DG.

Locked