From: Nathaniel G. A. <nat...@ya...> - 2004-11-14 13:41:33
|
you need to use a ScatterPlotDataSet not an AxisChartDataSet --- de...@in... 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 |