From: Arcadius A. <ah...@sh...> - 2004-03-07 09:53:36
|
Hello! I'm new to JCharts. I'm trying to modify the "ScatterPlotChartServlet" example to do what I need. The actual code in "ScatterPlotChartServlet" looks like the following: private ScatterPlotDataSet createScatterPlotDataSet() { Point2D.Double[] points = new Point2D.Double[ 20 ]; Point2D.Double[] points2 = new Point2D.Double[ 20 ]; for( int x = 0; x < 20; x++ ) { //--- y = x2 points[ x ] = ScatterPlotDataSet.createPoint2DDouble(); points[ x ].setLocation( x, Math.pow(x,2 ) ); } ScatterPlotDataSet scatterPlotDataSet = new ScatterPlotDataSet( this.createScatterPlotProperties() ); scatterPlotDataSet.addDataPoints( points, Color.red, "Proprietary" ); return scatterPlotDataSet; } Me, I'd like to draw 3 graphs, for instance : y=Math.pow(x,2) y=Math.pow(x,3) y=Math.sin(Math.PI*x) on the SAME chart. My question is: How can I modify the code of the "ScatterPlotChartServlet" above to have 3 graphs on the SAME chart? creating two others points2[] and points3[] objects for the 2 remaining graphs did not help. Thanks. AA. |