|
From: <de...@in...> - 2004-11-12 17:18:42
|
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
{
=20
=20
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.pink};
=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.yellow);=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
} |