From: Nathaniel G. A. <nat...@ya...> - 2003-10-15 03:21:03
|
You are passing NULL in for the ChartProperties, AxisProperties, LegendProperties, and BarChartProperties --- Christian Cryder <chr...@gr...> wrote: > Hi folks, > > I'm obviously doing something stupid, so maybe you can help me... Here's my > code snippet, taken from the samples: > ---------------------------------- > BarChartProperties barChartProperties = null; > LegendProperties legendProperties = null; > AxisProperties axisProperties = null; > ChartProperties chartProperties = null; > int width = 550; > int height = 360; > > try { > String[] xAxisLabels = {"1995", "1996", "1997", "1998", "1999", "2000", > "2001", "2002", "2003", "2004"}; > String xAxisTitle = "Years"; > String yAxisTitle = "Problems"; > String title = "Micro$oft At Work"; > IAxisDataSeries dataSeries = new DataSeries( xAxisLabels, xAxisTitle, > yAxisTitle, title ); > > double[][] data = new double[][]{{1500, 6880, 4510, 2600, 1200, 1580, > 8000, 4555, 4000, 6120}}; > String[] legendLabels = {"Bugs"}; > Paint[] paints = new Paint[]{Color.blue.darker()}; > dataSeries.addIAxisPlotDataSet( new AxisChartDataSet( data, > legendLabels, paints, ChartType.BAR, barChartProperties ) ); > AxisChart axisChart = new AxisChart( dataSeries, chartProperties, > axisProperties, legendProperties, width, height); > > ... > ServletEncoderHelper.encodePNG(axisChart, httpServletResponse); > ... > > catch(ChartDataException chartDataException) { > chartDataException.printStackTrace(); > } > ---------------------------------- > > Notice that I am _not_ calling renderWithImageMap(), getImageMap(), etc the > way the sample is. Instead, I'm trying to use the chart normally, just as an > image. > > The problem occurs within encodePNG()...it basically throws a null pointer > exception, and because the code was apparently compiled without line > numbers, I don't get a whole lot for debugging... > > Now, I tried a simple pie chart example, and that _did_ work...so obviously, > I am doing something specifically wrong here. Does anyone have any ideas? Or > do I have to go build the project from source in order to get line numbers > and then track it down from there. > > Any suggestions would be greatly appreciated... > > tia, > Christian > ---------------------------------------------- > Christian Cryder > Internet Architect, ATMReports.com > Project Chair, BarracudaMVC - http://barracudamvc.org > ---------------------------------------------- > "Coffee? I could quit anytime, just not today" > > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > SourceForge.net hosts over 70,000 Open Source Projects. > See the people who have HELPED US provide better services: > Click here: http://sourceforge.net/supporters.php > _______________________________________________ > jCharts-users mailing list > jCh...@li... > https://lists.sourceforge.net/lists/listinfo/jcharts-users __________________________________ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com |