[ jcharts-Bugs-814975 ] Having problem in PieChart

"SourceForge.net" <[email protected]> Sat, 27 Mar 2004 06:31:15 -0800
Newsgroups gmane.comp.krysalis.jcharts.devel
Message-ID <[email protected]>
Bugs item #814975, was opened at 2003-09-30 04:50
Message generated for change (Settings changed) made by nathaniel_auvil
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=116161&aid=814975&group_id=16161

Category: None
Group: None
>Status: Closed
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
>Assigned to: Nathaniel G. Auvil (nathaniel_auvil)
Summary: Having problem in PieChart

Initial Comment:
Dear sir,
i am plotting a pie chart  with the code given below.

String id = request.getParameter("id");
		String name = request.getParameter
("name");
		
		double[] data={0,0,0,0};
		String[] labels = new String
[data.length];
		labels = 
Util.constructStringArrayFromString("Queued - Not 
Assigned,Assigned - Not Started, Assigned - In Progress, 
Assigned - Wrapup",",");
		Paint[] paints= 
{Color.blue,Color.cyan,Color.red,Clor.yellow};

		PieChart2DProperties 
pieChart2DProperties = new PieChart2DProperties();
		pieChart2DProperties.setPieLabelType
( PieLabelType.VALUE_LABELS );
	
	pieChart2DProperties.setZeroDegreeOffset( 
110 );

		LegendProperties legendProperties = 
new LegendProperties();
		legendProperties.setPlacement
(LegendAreaProperties.RIGHT );
		legendProperties.setNumColumns( 1 );

		String heading = null;
		if(id.equals("QueuesChart2"))
			heading = ""+name+" 
Monitoring - Email";
		PieChartDataSet pieChartDataSet = 
new PieChartDataSet( heading, data, labels, paints, 
pieChart2DProperties );

		ChartProperties chartProperties = 
new ChartProperties();
		chartProperties.setBorderStroke( 
ChartStroke.DEFAULT_CHART_OUTLINE );

		PieChart2D pieChart = new PieChart2D
(pieChartDataSet, legendProperties, chartProperties, 
300, 200 );
		ServletEncoderHelper.encodeJPEG13
(pieChart, 1.0f, response);

This code draws the image well. but which displaying the 
code it throws an exception. which is also pasted below.


sun.dc.pr.PRException: endPath: bad path
        at sun.dc.pr.Rasterizer.endPath
(Rasterizer.java:535)
        at 
sun.java2d.pipe.DuctusRenderer.createShapeRasterizer
(DuctusRenderer.j
ava:291)
        at 
sun.java2d.pipe.DuctusShapeRenderer.renderPath
(DuctusShapeRenderer.ja
va:54)
        at sun.java2d.pipe.DuctusShapeRenderer.draw
(DuctusShapeRenderer.java:43)

        at sun.java2d.SunGraphics2D.draw
(SunGraphics2D.java:1594)
        at org.jCharts.nonAxisChart.PieChart2D.render
(Unknown Source)
        at org.jCharts.nonAxisChart.PieChart2D.renderChart
(Unknown Source)
        at org.jCharts.Chart.render(Unknown Source)
        at org.jCharts.encoders.BinaryEncoderUtil.render
(Unknown Source)
        at org.jCharts.encoders.JPEGEncoder13.encode
(Unknown Source)
        at 
org.jCharts.encoders.ServletEncoderHelper.encodeJPEG13
(Unknown Source
)
        at 
jsp_servlet._web._view._platform._monitoring._monitoring
.__piechart._
jspService(__piechart.java:173) 
_piechart.java is my file name		...

but when i change the value of data variable from 
double data[]={0,0,0,0};
to 
double data[]={1,1,1,1};

i want to remove this exception from my code.
if u will help me regarding this it will be helpful for me.
I am using jdk1.3.
Thanks in Advance

Happy Manocha


----------------------------------------------------------------------

Comment By: Nathaniel G. Auvil (nathaniel_auvil)
Date: 2004-02-11 22:12

Message:
Logged In: YES 
user_id=118938

Did you change your data to double[] data= {1,1,1,1}?  Are
you sure your servlet was not cached with the 0,0,0,0?

Can you generate a pie chart from the example servlet
application?  Can you generate a pie chart in a standalone
java application?

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2004-02-11 21:52

Message:
Logged In: NO 

sun.dc.pr.PRException

It also took place in my web app .


----------------------------------------------------------------------

Comment By: Nathaniel G. Auvil (nathaniel_auvil)
Date: 2003-09-30 10:00

Message:
Logged In: YES 
user_id=118938

Why are you trying to plot a pie chart with no data
(data[]={0,0,0,0})?

We do not validate against a chart with no data for all data
points in the chart.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=116161&aid=814975&group_id=16161


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click