Change the origin of the y axis

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

Change the origin of the y axis

Post by Laurent » Thu Mar 06, 2003 9:25 am

I am trying to set the origin of the y axis to a given positive value. How can I handle this with cewolf? I think of using the postprocessing capabilities of cewolf
thanks,

David Gilbert

Re: Change the origin of the y axis

Post by David Gilbert » Thu Mar 06, 2003 5:33 pm

Hi Laurent,

I'm not sure about how you do it in Cewolf...but you can use the setRange(...) method in the axis:

ValueAxis axis = myPlot.getRangeAxis();
axis.setRange(...);

Regards,

Dave Gilbert

Laurent

Re: Change the origin of the y axis

Post by Laurent » Fri Mar 07, 2003 8:46 am

I'll try this. I have tryed something like setMinimumAxisValue(double min)but it seems that the version of JFreeChart provided with cewolf is deprecated. The method setMinimumAxisValue(double min) did not exist for the Axis class. The trouble is that if I want to use a latest version of JFreeChart in CeWolf I would have to compile both JFreeChart and CeWolf. And I don't know how to use ant which seems to be the standard for Java compilation. I any one has a very Basic command line for ant (a single line ) it would help.

the following is the postprocessor I was trying to compile:

// it would normally be in a class that extends ChartPostProcessor

ChartPostProcessor chartCustomize = new ChartPostProcessor() {
public void processChart(Object chart, Map params) {
// get a reference to the plot for further customisation...
CategoryPlot plot = (CategoryPlot)((JFreeChart)chart).getCategoryPlot();
HorizontalBarRenderer renderer = (HorizontalBarRenderer)plot.getRenderer();

// change the minimum value of the Horizontal axis...
HorizontalNumberAxis axis = (HorizontalNumberAxis)plot.getDomainAxis();
axis.setMinimumAxisValue(10000.0);
}
};

Locked