From: Daniel H. <Dan...@di...> - 2003-07-31 19:06:50
|
thank you for the quick response :) I have made the change and now I am getting this error.. org.jCharts.properties.PropertyException: You must define a Stroke = Object for each Line in the LineChart. at org.jCharts.properties.LineChartProperties.validate(Unknown Source) at org.jCharts.chartData.AxisChartDataSet.validate(Unknown Source) at org.jCharts.chartData.AxisDataSeries.validate(Unknown Source) The changes I made are: // Define both line data points double[][] data =3D new double[][]{{1500, 6880, 4510, 2600, 1200, 1580, = 8000, 4555, 4000, 6120},{2500, 7880, 5510, 8600, 2200, 2580, 9000, 5555, = 3000, 1120}}; // Define the Labels for both lines String[] legendLabels =3D {"Bugs","tests"}; // Define both line colors Paint[] linePaints =3D new Paint[]{Color.green,Color.blue}; // Define strokes/shapes for both lines Stroke[] strokes =3D {LineChartProperties.DEFAULT_LINE_STROKE, = LineChartProperties.DEFAULT_LINE_STROKE}; Shape[] shapes =3D {PointChartProperties.SHAPE_DIAMOND, = PointChartProperties.SHAPE_CIRCLE}; this.lineChartProperties =3D new LineChartProperties( strokes, shapes ); dataSeries.addIAxisPlotDataSet( new AxisChartDataSet( data, = legendLabels, linePaints, ChartType.LINE, this.lineChartProperties )); AxisChart axisChart =3D new AxisChart( dataSeries, this.chartProperties, = this.axisProperties, this.legendProperties, this.width, this.height ); =09 ServletEncoderHelper.encodeJPEG13( axisChart, 1.0f, httpServletResponse = ); <--- GENERATES THE ERROR MESSAGE indicating the stroke is not defined = for both lines? many thanx again for any suggestions.. -----Original Message----- From: Nathaniel G. Auvil [mailto:nat...@ya...] Sent: Thursday, July 31, 2003 11:53 AM To: jch...@li... Subject: Re: [jCharts-users] LineCharts Question multiple data series... --- Daniel Hopkins <Dan...@di...> wrote: > Being a newbie to the JCharts, I am having difficulty getting a graph = to correctly display > multiple lines of data, and have not been able to find an example that = does this. >=20 > I see http://jcharts.sourceforge.net/samples/line.html shows a sample, = but no code is provided. >=20 > I have played/modifed the code from ComboChartServlet example, where I = simplied added another > data series, but this too fail, unless the second data series is = configured to render using > ChartType.BAR >=20 > The modified service method is shown below... >=20 > If I modify the one of the lines: >=20 > dataSeries.addIAxisPlotDataSet( new AxisChartDataSet( data, = legendLabels, paints, > ChartType.LINE, this.lineChartProperties ) ); >=20 > to >=20 > dataSeries.addIAxisPlotDataSet( new AxisChartDataSet( data, = legendLabels, paints, ChartType.BAR, > this.barChartProperties ) ); >=20 > it will render this series correctly as a bar chart, and the other as = a line chart. But I > cannot get them both to render as lines..what gives? >=20 > I must be missing something....any suggestions would be greatly = appreciated All your line data should be in the same IAxisChartDataSet; it takes a = double[][] for the data values. Each IAxisPlotDataSet in the DataSeries Object represents a specific = kind of chart. =3D=3D=3D=3D=3D http://nathaniel-auvil.blog-city.com/ __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/= 01 _______________________________________________ jCharts-users mailing list jCh...@li... https://lists.sourceforge.net/lists/listinfo/jcharts-users |