[ jcharts-Bugs-814990 ] Problem in PieChart

"SourceForge.net" <[email protected]> Tue, 30 Sep 2003 07:01:09 -0700
Newsgroups gmane.comp.krysalis.jcharts.devel
Message-ID <[email protected]>
Bugs item #814990, was opened at 2003-09-30 05:35
Message generated for change (Settings changed) made by nathaniel_auvil
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=116161&aid=814990&group_id=16161

Category: None
Group: None
>Status: Deleted
>Resolution: Duplicate
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: Problem in PieChart

Initial Comment:
Having problem in PieChart 

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

Please update me at [email protected] 



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

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


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf