if(labelFormat==LabelFormatUtil.LABEL_FORMAT_DATE && rangeAxis.getRange().getLowerBound()==0) {
lower = smallest;
upper=biggest;
try {
DateTime d = Caster.toDate(Caster.toDouble(lower),true,null,null);
lower = DateAdd.call(pageContext,"yyyy", -1, d).castToDoubleValue(lower);
}
catch (PageException e) {}
}
if(!Double.isNaN(scalefrom))lower=scalefrom;
if(!Double.isNaN(scaleto))upper=scaleto;
rangeAxis.setRange(new Range(lower,upper),true,true);
}
else if(plot instanceof XYPlot) {
XYPlot cp=(XYPlot) plot;
ValueAxis rangeAxis = cp.getRangeAxis();
Range r=rangeAxis.getRange();
double lower=r.getLowerBound();
double upper=r.getUpperBound();
if(labelFormat==LabelFormatUtil.LABEL_FORMAT_DATE && rangeAxis.getRange().getLowerBound()==0) {
lower = smallest;
upper=biggest;
try {
DateTime d = Caster.toDate(Caster.toDouble(lower),true,null,null);
lower = DateAdd.call(pageContext,"yyyy", -1, d).castToDoubleValue(lower);
}
catch (PageException e) {}
}
if(!Double.isNaN(scalefrom))lower=scalefrom;