Scale of a Xaxis NullPointerException
[email protected] Wed, 01 Sep 2004 03:49:22 -0400
| Newsgroups | gmane.comp.krysalis.jcharts.user |
|---|---|
| Message-ID | <[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
-------------------------------------------------------
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