Re: scatter plots

"Nathaniel G. Auvil" <[email protected]> Sun, 14 Nov 2004 05:41:24 -0800 (PST)
Newsgroups gmane.comp.krysalis.jcharts.user
Message-ID <[email protected]>
you need to use a ScatterPlotDataSet not an AxisChartDataSet


--- [email protected] wrote:

> Hi,
> 
> Could anybody tell me whats wrong with the following code to plot a scatter plot. It doesnt show
> the data points. The title, legends and axis titles diplay correclty though.
> 
> Thanks
> Deepa
> 
> 
> public void scatterChartDraw(BaseXWPropertyMap view, ChartDataSet cData, BaseXWPropertyMap
> style) throws ChartDataException, PropertyException
>  {
>   
>     
>   String[] xAxisLabels = { "1998", "1999", "2000", "2001",
>                                      "2002", "2003", "2004" };
>    String xAxisTitle = "Years";
>    String yAxisTitle = "Problems";
>    String title = "Microsoft at Work";
>    DataSeries dataSeries = new DataSeries(xAxisLabels, xAxisTitle,
>      yAxisTitle, title );
>    
>    double[][] data = new double[][]{ {250, 45, 36, 66, 145, 80, 55} };
>    String[] legendLabels = { "Bugs" };
>    Paint[] paints = {Color.pink};
>    
>    Stroke[] strokes = { ScatterPlotProperties.DEFAULT_LINE_STROKE };
>    Shape[]  shapes = { PointChartProperties.SHAPE_DIAMOND};
>    ScatterPlotProperties properties =
>     new ScatterPlotProperties(strokes, shapes);
>    
>    AxisChartDataSet axisChartDataSet =
>     new AxisChartDataSet(data, legendLabels, paints,
>       ChartType.SCATTER_PLOT, properties );
>    dataSeries.addIAxisPlotDataSet (axisChartDataSet);
>    
>    ChartProperties chartProperties   = new ChartProperties();
>    chartProperties.setBackgroundPaint((Paint) Color.yellow); 
>    chartProperties.setBorderStroke( (ChartStroke) ChartStroke.DEFAULT_AXIS ); 
>    
>    AxisProperties axisProperties     = new AxisProperties();
>    LegendProperties legendProperties = new LegendProperties();
>    
>    AxisChart axisChart= new AxisChart(dataSeries, chartProperties,
>      axisProperties, legendProperties,
>     width, height);
>  
>    this.exportImage( axisChart, filePath );
>   
> 
>  }



		
__________________________________ 
Do you Yahoo!? 
Check out the new Yahoo! Front Page. 
www.yahoo.com 
 



-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8