From: <de...@in...> - 2004-11-09 19:29:33
|
Hi,=20 I was trying to create a scatter plot. I could get the outline of the = chart and the labels, titles etc.. but no data points. Following is the = code. Could you tell me whats going wrong .. =20 public void scatterChartDraw(BaseXWPropertyMap view, ChartDataSet cData, = BaseXWPropertyMap style) throws ChartDataException, PropertyException { String[] xAxisLabels =3D { "1998", "1999", "2000", "2001", "2002", "2003", "2004" }; String xAxisTitle =3D "Years"; String yAxisTitle =3D "Problems"; String title =3D "Microsoft at Work"; DataSeries dataSeries =3D new DataSeries(xAxisLabels, xAxisTitle, yAxisTitle, title ); =20 double[][] data =3D new double[][]{ {250, 45, 36, 66, 145, 80, 55} }; String[] legendLabels =3D { "Bugs" }; Paint[] paints =3D {Color.red}; =20 Stroke[] strokes =3D { ScatterPlotProperties.DEFAULT_LINE_STROKE }; Shape[] shapes =3D { PointChartProperties.SHAPE_DIAMOND}; ScatterPlotProperties properties =3D new ScatterPlotProperties(strokes, shapes); =20 AxisChartDataSet axisChartDataSet =3D new AxisChartDataSet(data, legendLabels, paints, ChartType.SCATTER_PLOT, properties ); dataSeries.addIAxisPlotDataSet (axisChartDataSet); =20 ChartProperties chartProperties =3D new ChartProperties(); chartProperties.setBackgroundPaint((Paint) Color.LIGHT_GRAY );=20 chartProperties.setBorderStroke( (ChartStroke) = ChartStroke.DEFAULT_AXIS );=20 =20 AxisProperties axisProperties =3D new AxisProperties(); LegendProperties legendProperties =3D new LegendProperties(); =20 AxisChart axisChart=3D new AxisChart(dataSeries, chartProperties, axisProperties, legendProperties, width, height); =20 this.exportImage( axisChart, filePath ); =20 } |