From: Nathaniel G. A. <nat...@ya...> - 2003-07-31 18:53:01
|
--- 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. > > I see http://jcharts.sourceforge.net/samples/line.html shows a sample, but no code is provided. > > 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 > > The modified service method is shown below... > > If I modify the one of the lines: > > dataSeries.addIAxisPlotDataSet( new AxisChartDataSet( data, legendLabels, paints, > ChartType.LINE, this.lineChartProperties ) ); > > to > > dataSeries.addIAxisPlotDataSet( new AxisChartDataSet( data, legendLabels, paints, ChartType.BAR, > this.barChartProperties ) ); > > 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? > > 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. ===== http://nathaniel-auvil.blog-city.com/ __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com |