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. |
From: sitanshu m. <mah...@gm...> - 2006-10-26 12:12:38
|
Hey! shalini u check out through jfreecharts >> tht's also another way to achive all this >> bar charts, stacked bar charts, pie charts and time charts if u need a jar then i am having >> let me know >> even u can get that from google!!! bye! thanks and regards Sitanshu Maheshwari +919911373111 On 10/26/06, KUMARARAJA Shalini <SKu...@co...> wrote: > > Hi, > > > > 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. > > > > double maxX=0,maxY=0,minX=0,minY=0; > > Point2D.Double[] points = new Point2D.Double > [TotItems]; > > > > for (int iCount=0;iCount<TotItems;iCount++ ) > > { > > points[iCount] = > ScatterPlotDataSet.createPoint2DDouble(); > > > points[iCount].setLocation(xAxis[iCount], yAxis[iCount]); > > if (xAxis[iCount] > maxX) > maxX=xAxis[iCount]; > > if (yAxis[iCount] > maxY) > maxY=yAxis[iCount]; > > if (yAxis[iCount] < minY) > minY=yAxis[iCount]; > > } > > > > Stroke[] strokes = new Stroke[]{new > BasicStroke()}; > > Shape[] shapes = new Shape[]{new Polygon( new > int[]{0, 5, 10, 5}, new int[]{5, 0, 5, 10}, 4 )}; > > > > ScatterPlotDataSet scatterPlotDataSet = new > ScatterPlotDataSet( new ScatterPlotProperties( strokes, shapes ) ); > > scatterPlotDataSet.addDataPoints( points, > Color.blue, null ); > > > > ScatterPlotDataSeries scatterPlotDataSeries = new > ScatterPlotDataSeries( scatterPlotDataSet,xAxisTitle,yAxisTitle,null ); > > DataAxisProperties xAxisProperties = new > DataAxisProperties(); > > > > /*********The DataSeries created as in the above code is passed as in the > below code.**************/ > > > > ScatterPlotAxisChart scatterPlotAxisChart = new > ScatterPlotAxisChart( > scatterPlotDataSeries,chartProperties,axisProperties,legendProperties,width*2,height*2 > ); > > > > bufferedImage = new BufferedImage( > scatterPlotAxisChart.getImageWidth(), scatterPlotAxisChart.getImageHeight(), > BufferedImage.TYPE_INT_RGB ); > > scatterPlotAxisChart.setGraphics2D( > bufferedImage.createGraphics() ); > > scatterPlotAxisChart.render(); > > > > Pls let us know how this can be achieved. > > > > > > 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. > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > _______________________________________________ > jCharts-developers mailing list > jCh...@li... > https://lists.sourceforge.net/lists/listinfo/jcharts-developers > > > |