Forums Register Login

Graphics Pie Chart!

+Pie Number of slices to send: Send
Can anyone tell me why when I run this the output is not correct? It should be just a plain circle with pie slices....

+Pie Number of slices to send: Send
I am unaware of your requirements. I am not sure if you are looking for an even distrubution of the values, or a circle with "slices" representing values. First I just added a drawcircle method, which I first envoked, so I could focus on the slices (see code addition). I then removed the calculations from the setAngle Method (again, see code modification). Code needs cleaning. Hope it helps.

[code]

...
void drawcircle() {
Arc2D arc = new Arc2D.Double(0,0,width,height,0,360,Arc2D.PIE);
arcs.add(arc);
}
...
public void setAngle(double value) {
angle = value;
}
+Pie Number of slices to send: Send
Please don't use two threads for the same problem. This is a continuation of this thread; please continue all discussion there.
+Pie Number of slices to send: Send
 

Originally posted by Campbell Ritchie:
Please don't use two threads for the same problem. This is a continuation of this thread; please continue all discussion there.



Closing this duplicate.
Don't count your weasels before they've popped. And now for a mulberry bush related tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


Reply locked
This thread has been viewed 2486 times.
Similar Threads
drawing a portion of a circle
I want to insert Data into the pie chart.I have put the code to gernate the Pie
How to chnage the angle of a button ?
HOW to draw an ARC on a Frame / Panel
simple gui task
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 04:30:30.