|
From: Nathaniel G. A. <nat...@ya...> - 2004-03-08 02:13:22
|
you have to add the other datapoints to the chart, as in:
scatterPlotDataSet.addDataPoints( points, Color.red, "Proprietary" );
scatterPlotDataSet.addDataPoints( points2, Color.red, "Proprietary" );
--- "Arcadius A." <ah...@sh...> wrote:
> 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.
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> _______________________________________________
> jCharts-users mailing list
> jCh...@li...
> https://lists.sourceforge.net/lists/listinfo/jcharts-users
__________________________________
Do you Yahoo!?
Yahoo! Search - Find what youre looking for faster
http://search.yahoo.com
|