From: <jle...@ne...> - 2004-09-03 12:06:53
|
here is the stacktrace java.lang.NullPointerException render org.jCharts.axisChart.axis.XAxis -1 renderChart org.jCharts.axisChart.AxisChart -1 render org.jCharts.Chart -1 render org.jCharts.encoders.BinaryEncoderUtil -1 encode org.jCharts.encoders.JPEGEncoder13 -1 getGraphe com.GrapheScatter 308 main com.EssaiGrpahe 46 null null i use this code for see them System.out.println(f.getClass().getName()); StackTraceElement stcak[]=f.getStackTrace(); for (int t=0;t<stcak.length;t++) { System.out.println(stcak[t].getMethodName()); System.out.println(stcak[t].getClassName()); System.out.println(stcak[t].getLineNumber()); } System.out.println(f.getMessage()); System.out.println(f.getLocalizedMessage()); >Message: 2 >Date: Wed, 01 Sep 2004 03:49:22 -0400 >From: jle...@ne... >To: jch...@li... >Subject: [jCharts-users] Scale of a Xaxis NullPointerException >Reply-To: jch...@li... > >I don't know why i have a NullPointerException when i use the jpeg encoder >Is there anaone could help me..... >It is always the same problem with the scale of the xaxis on a point chart > > >DataAxisProperties x=new DataAxisProperties(); > DataAxisProperties y=new DataAxisProperties(); > > > > //DataAxisProperties datatry = (DataAxisProperties)axisProperties.getXAxisProperties(); > x.setNumItems(this.intervalle); > x.setUserDefinedScale(0,24); > x.setRoundToNearest(0); > > //DataAxisProperties dataAxisProperties= (DataAxisProperties) axisProperties.getYAxisProperties(); > //calcul de la meilleur echelle possible > int n=(int)Math.ceil(new Double(String.valueOf(this.valeurMax/100)).doubleValue()); > y.setNumItems(n+2); > y.setUserDefinedScale( 0, 100 ); > y.setRoundToNearest( 0 ); > > > AxisProperties axisProperties= new AxisProperties((LabelAxisProperties)x,y); > > //ligne pour le cadrillage > ChartStroke xAxisGridLines= new ChartStroke( new BasicStroke( 0.5f ), Color.GRAY ); > axisProperties.getXAxisProperties().setGridLineChartStroke( xAxisGridLines ); > axisProperties.getXAxisProperties().setShowGridLines( AxisTypeProperties.GRID_LINES_ONLY_WITH_LABELS); > axisProperties.getXAxisProperties().setShowTicks( AxisTypeProperties.TICKS_NONE ); > axisProperties.getXAxisProperties().setPaddingBetweenAxisAndLabels(5.0f); > > > //generation finale > AxisChart axisChart= new AxisChart( dataSeries, chartProperties, axisProperties,null, 700, 500 ); > > > // axisChart.xAxis=new XAxis(axisChart,this.intervalle); > > try{ > JPEGEncoder13.encode(axisChart,1.0f,new FileOutputStream(prop.getProperty("GRAPHE")+chemin+".jpg")); > } > >__________________________________________________________________ >Switch to Netscape Internet Service. >As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register > >Netscape. Just the Net You Need. > >New! Netscape Toolbar for Internet Explorer >Search from anywhere on the Web and block those annoying pop-ups. >Download now at http://channels.netscape.com/ns/search/install.jsp > > >Message: 6 >Date: Wed, 1 Sep 2004 19:51:29 -0700 (PDT) >From: "Nathaniel G. Auvil" <nat...@ya...> >Subject: Re: [jCharts-users] Scale of a Xaxis NullPointerException >To: jch...@li... >Reply-To: jch...@li... > > >can you attach the stacktrace? > > > >--- jle...@ne... wrote: > >> I don't know why i have a NullPointerException when i use the jpeg encoder >> Is there anaone could help me..... >> It is always the same problem with the scale of the xaxis on a point chart >> >> >> DataAxisProperties x=new DataAxisProperties(); >> DataAxisProperties y=new DataAxisProperties(); >> >> >> >> //DataAxisProperties datatry = (DataAxisProperties)axisProperties.getXAxisProperties(); >> x.setNumItems(this.intervalle); >> x.setUserDefinedScale(0,24); >> x.setRoundToNearest(0); >> >> //DataAxisProperties dataAxisProperties= (DataAxisProperties) >> axisProperties.getYAxisProperties(); >> //calcul de la meilleur echelle possible >> int n=(int)Math.ceil(new Double(String.valueOf(this.valeurMax/100)).doubleValue()); >> y.setNumItems(n+2); >> y.setUserDefinedScale( 0, 100 ); >> y.setRoundToNearest( 0 ); >> >> >> AxisProperties axisProperties= new AxisProperties((LabelAxisProperties)x,y); >> >> //ligne pour le cadrillage >> ChartStroke xAxisGridLines= new ChartStroke( new BasicStroke( 0.5f ), Color.GRAY ); >> axisProperties.getXAxisProperties().setGridLineChartStroke( xAxisGridLines ); >> axisProperties.getXAxisProperties().setShowGridLines( >> AxisTypeProperties.GRID_LINES_ONLY_WITH_LABELS); >> axisProperties.getXAxisProperties().setShowTicks( AxisTypeProperties.TICKS_NONE ); >> axisProperties.getXAxisProperties().setPaddingBetweenAxisAndLabels(5.0f); >> >> >> //generation finale >> AxisChart axisChart= new AxisChart( dataSeries, chartProperties, axisProperties,null, 700, >> 500 ); >> >> >> // axisChart.xAxis=new XAxis(axisChart,this.intervalle); >> >> try{ >> JPEGEncoder13.encode(axisChart,1.0f,new >> FileOutputStream(prop.getProperty("GRAPHE")+chemin+".jpg")); >> } >> >> __________________________________________________________________ >> Switch to Netscape Internet Service. >> As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register >> >> Netscape. Just the Net You Need. >> >> New! Netscape Toolbar for Internet Explorer >> Search from anywhere on the Web and block those annoying pop-ups. >> Download now at http://channels.netscape.com/ns/search/install.jsp >> >> >> ------------------------------------------------------- >> This SF.Net email is sponsored by BEA Weblogic Workshop >> FREE Java Enterprise J2EE developer tools! >> Get your free copy of BEA WebLogic Workshop 8.1 today. >> http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click >> _______________________________________________ >> jCharts-users mailing list >> jCh...@li... >> https://lists.sourceforge.net/lists/listinfo/jcharts-users >> > > > > >__________________________________ >Do you Yahoo!? >New and Improved Yahoo! Mail - Send 10MB messages! >http://promotions.yahoo.com/new_mail > > > >--__--__-- > >_______________________________________________ >jCharts-users mailing list >jCh...@li... >https://lists.sourceforge.net/lists/listinfo/jcharts-users > > >End of jCharts-users Digest > __________________________________________________________________ Switch to Netscape Internet Service. As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register Netscape. Just the Net You Need. New! Netscape Toolbar for Internet Explorer Search from anywhere on the Web and block those annoying pop-ups. Download now at http://channels.netscape.com/ns/search/install.jsp |