Ceowlf XYSplineChart not Connecting some DataPoints.

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
sunil.lakkakula
Posts: 1
Joined: Wed Mar 23, 2011 9:54 am
antibot: No, of course not.

Ceowlf XYSplineChart not Connecting some DataPoints.

Post by sunil.lakkakula » Thu Mar 24, 2011 5:15 am

For Some values the Chart is getting plotted correctly but for some values the Data points are not getting Connected.It Just plots the Graph by marking the datapoints at appropriate coordinates.
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);
    }
    }


Locked