From: Chris W. <cw...@go...> - 2004-12-08 19:28:46
|
Ok, I guess I get to answer my own question. You add data to a ScatterPlotDataSet. I finally figured out that the createScatterPlotDataSet method in the ScatterPlotTestDriver was not really set up to create multiple datasets. This change to that method will create random data for any numberOfDataSets. private ScatterPlotDataSet createScatterPlotDataSet( int numberOfDataSets, int numberOfValuesToCreate, int xMinValue, int xMaxValue, int yMinValue, int yMaxValue ) throws ChartDataException { ScatterPlotDataSet scatterPlotDataSet= new ScatterPlotDataSet( this.getScatterPlotProperties( numberOfDataSets ) ); Point2D.Double[] points; for( int i=0; i < numberOfDataSets; i++ ) { points= TestDataGenerator.getRandomPoints( numberOfValuesToCreate, xMinValue, xMaxValue, yMinValue, yMaxValue ); Paint paint = TestDataGenerator.getRandomPaint(); String[] legendLabels = TestDataGenerator.getRandomStrings( 1, 12, false ); scatterPlotDataSet.addDataPoints( points, paint, legendLabels[ 0 ] ); } return scatterPlotDataSet; } On Wednesday 08 December 2004 10:08 am, Chris Ward wrote: > What is the difference between a ScatterPlotDataSet, and a > ScatterPlotDataSeries. The ScatterPlotDataSet appears to have the methods > to add multiple lines to it I think. > > The ScatterPlotTestDriver creates one line with a ScatterPlotDataSet, then > creates a ScatterPlotDataSeries with that DataSet and the labels. If I want > multiple plotted lines, which class do I add the data for the line to? > > scatterPlotDataSet.addDataPoints( points, paint, legendLabel ); ? > scatterPlotDataSeries.addIAxisPlotDataSet( iScatterPlotDataSet ); ? > > chris |