Re: scatter plots

Chris Ward <[email protected]> Wed, 8 Dec 2004 13:28:47 -0600
Newsgroups gmane.comp.krysalis.jcharts.user
Organization Integral Business Solutions
Message-ID <[email protected]>
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


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/