From: KUMARARAJA S. <SKu...@co...> - 2006-10-26 11:09:40
|
Hi, =20 We need to draw a graph with plots of two different value sets having different shapes and colors for those two value sets. The present method supports only one dataset. =20 double maxX=3D0,maxY=3D0,minX=3D0,minY=3D0; Point2D.Double[] points =3D new Point2D.Double[TotItems]; =20 for (int iCount=3D0;iCount<TotItems;iCount++ ) { points[iCount] =3D ScatterPlotDataSet.createPoint2DDouble(); =20 points[iCount].setLocation(xAxis[iCount], yAxis[iCount]); if (xAxis[iCount] > maxX) maxX=3DxAxis[iCount]; if (yAxis[iCount] > maxY) maxY=3DyAxis[iCount]; if (yAxis[iCount] < minY) minY=3DyAxis[iCount]; } =20 Stroke[] strokes =3D new Stroke[]{new BasicStroke()}; Shape[] shapes =3D new Shape[]{new Polygon( new int[]{0, 5, 10, 5}, new int[]{5, 0, 5, 10}, 4 )}; =20 ScatterPlotDataSet scatterPlotDataSet =3D new ScatterPlotDataSet( new ScatterPlotProperties( strokes, shapes ) ); scatterPlotDataSet.addDataPoints( points, Color.blue, null ); =20 ScatterPlotDataSeries scatterPlotDataSeries =3D new ScatterPlotDataSeries( scatterPlotDataSet,xAxisTitle,yAxisTitle,null ); DataAxisProperties xAxisProperties =3D new DataAxisProperties(); =20 /*********The DataSeries created as in the above code is passed as in the below code.**************/ =20 ScatterPlotAxisChart scatterPlotAxisChart =3D = new ScatterPlotAxisChart( scatterPlotDataSeries,chartProperties,axisProperties,legendProperties,wi dth*2,height*2 ); =20 bufferedImage =3D new BufferedImage( scatterPlotAxisChart.getImageWidth(), scatterPlotAxisChart.getImageHeight(), BufferedImage.TYPE_INT_RGB ); scatterPlotAxisChart.setGraphics2D( bufferedImage.createGraphics() ); scatterPlotAxisChart.render(); =20 Pls let us know how this can be achieved. =20 =20 Regards, Shalini.K Confidentiality Statement: This message is intended only for the individual or entity to which it = is addressed. It may contain privileged, confidential information which = is exempt from disclosure under applicable laws. If you are not the = intended recipient, please note that you are strictly prohibited from = disseminating or distributing this information (other than to the = intended recipient) or copying this information. If you have received = this communication in error, please notify us immediately by return = email. |