From: Christian C. <chr...@gr...> - 2003-10-15 00:04:30
|
For what its worth, I now have a stack trace... java.lang.NullPointerException at org.jCharts.Chart.render(Chart.java:156) at org.jCharts.encoders.BinaryEncoderUtil.render(BinaryEncoderUtil.java:90) at org.jCharts.encoders.PNGEncoder.encode(PNGEncoder.java:91) at org.jCharts.encoders.ServletEncoderHelper.encodePNG(ServletEncoderHelper.jav a:137) Which traces to this: this.graphics2D.setPaint( this.chartProperties.getBackgroundPaint() ); Suggestions? Christian ---------------------------------------------- Christian Cryder Internet Architect, ATMReports.com Project Chair, BarracudaMVC - http://barracudamvc.org ---------------------------------------------- "Coffee? I could quit anytime, just not today" > -----Original Message----- > From: jch...@li... > [mailto:jch...@li...]On Behalf Of Christian > Cryder > Sent: Tuesday, October 14, 2003 6:59 PM > To: jCharts-users > Subject: [jCharts-users] getting started > > > 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 |