|
From: <jle...@ne...> - 2004-09-01 07:49:33
|
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
|