scatter plots
<[email protected]> Fri, 12 Nov 2004 11:28:34 -0600
| Newsgroups | gmane.comp.krysalis.jcharts.user |
|---|---|
| Message-ID | <[email protected]> |
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 );
}