Hello,
We are developing the a software for drawing graphs using the JFreeChart package, without messing with any classes of JFreeChart.We don't want to mess with the JFreeChart package because we will be submitting them the Log-plotting capability, which we have implemented, and on the process of refining it.
I am just drawing the Horizontal Line graphs.
But in some of my plots the single Y-axis value, tickLabels and the rendered line are not aligned. This problem is becuase of the fact that in the function autoAdjustRange() function, JFreeChart is doing the following operation:
double lower = r.getLowerBound();
double upper = r.getUpperBound();
double range = upper-lower;
// ensure the autorange is at least<minRange> in size...
double minRange = this.autoRangeMinimumSize.doubleValue();
if (range<minRange) {
upper = (upper+lower+minRange)/2;
lower = (upper+lower-minRange)/2;
}
In my case my upperBound and lowerBound are equal and there difference comes out to be zero which is smaller than minRange(pow(10,-7))
so it automatically adjust my scales.
In many of my plots the difference between the upperBound and lowerBound goes even to pow(10,-25) and below. And minRange value is creating a lots of problem for us.
I have added the following lines in the refreshTicks() function of the VerticalNumberAxis class, to solve my above problem.
if(count ==1){
if (plot instanceof VerticalValuePlot) {
VerticalValuePlot vvp= (VerticalValuePlot)plot;
Range r = vvp.getVerticalDataRange();
lowestTickValue=r.getLowerBound();
}
}
Is there some other way that i can solve that problem.
Thanks
With Regards
Nitin
Problems in autoAdjustRange() function
Re: Problems in autoAdjustRange() function
Can you send me screen copy showing the problem?
You can change the minimum size of the auto range if you need a smaller value, using the setAutoRangeMinimumSize(...0) method in the NumberAxis class.
Regards,
DG
You can change the minimum size of the auto range if you need a smaller value, using the setAutoRangeMinimumSize(...0) method in the NumberAxis class.
Regards,
DG