RE: Scale of a Xaxis NullPointerException
[email protected] Fri, 03 Sep 2004 08:06:41 -0400
| Newsgroups | gmane.comp.krysalis.jcharts.user |
|---|---|
| Message-ID | <[email protected]> |
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: [email protected]
>To: [email protected]
>Subject: [jCharts-users] Scale of a Xaxis NullPointerException
>Reply-To: [email protected]
>
>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" <[email protected]>
>Subject: Re: [jCharts-users] Scale of a Xaxis NullPointerException
>To: [email protected]
>Reply-To: [email protected]
>
>
>can you attach the stacktrace?
>
>
>
>--- [email protected] 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
>> [email protected]
>> 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
>[email protected]
>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
-------------------------------------------------------
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