please give any hint where I might have missed.
Code: Select all
<cewolf:chart id="plotCorrelationChart" type="xy" />
..
<cewolf:chartpostprocessor id="plotCorrelationPostProcessor" />
<cewolf:param name="xaxisMarker" value="<%=XScaleMarker%>"></cewolf:param>
<cewolf:param name="yaxisMarker" value="<%=YScaleMarker %>"></cewolf:param>
<cewolf:param name="xaxisMaxLimit"
value="<%=String.valueOf(chartProperties.get_x_maximum())%>"></cewolf:param>
<cewolf:param name="yaxisMaxLimit"
value="<%=String.valueOf(chartProperties.get_y_maximum())%>"></cewolf:param>
...
public final class PlotCorrelationPostProcessor implements ChartPostProcessor,Serializable {
public void processChart(final Object chart, final Map params) {
if (((JFreeChart) chart).getPlot().getClass() == XYPlot.class) {
JFreeChart jfreeChart=(JFreeChart) chart;
XYPlot xyPlot=(XYPlot) jfreeChart.getPlot();
setXaxisMaxLimit(chart, params);
setYaxisMaxLimit(chart, params);
}
}
public void setXaxisMaxLimit(final Object chart, final Map params) {
String xaxismax= (String) params.get("xaxisMaxLimit");
String xaxislabel= ( String ) params.get("xaxislabel");
this.xaxisMaxVal =Double.parseDouble(xaxismax);
JFreeChart jfreeChart=(JFreeChart) chart;
XYPlot xyPlot=(XYPlot )jfreeChart.getPlot();
//xis xAxis = new NumberAxis (xaxislabel);
ValueAxis xAxis= new NumberAxis (xaxislabel);
xAxis.setLowerBound(1.0);
xAxis.setUpperBound(this.xaxisMaxVal );
xAxis.setLabel(xaxislabel);
xyPlot.setDomainAxis(xAxis);
/* String xMaxStr="1";
for(int i=0;i<=(xaxismax.length()+2);i++) {
xMaxStr=xMaxStr+"0";
}
this.xaxisMaxVal=Double.parseDouble(xMaxStr);
System.out.println("SEtting the Upper Limit X Axis :-->"+this.xaxisMaxVal);*/
}
public void setYaxisMaxLimit(final Object chart, final Map params) {
String yaxislabel= ( String ) params.get("yaxislabel");
String yaxismax= (String) params.get("yaxisMaxLimit");
JFreeChart jfreeChart=(JFreeChart) chart;
XYPlot xyPlot=jfreeChart.getXYPlot();
ValueAxis yAxis= new NumberAxis (yaxislabel);
this.yaxisMaxVal =Double.parseDouble(yaxismax);
yAxis.setLowerBound(0.0);
yAxis.setUpperBound(this.yaxisMaxVal );
xyPlot.setRangeAxis(yAxis);
}
}