Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Graphics Pie Chart!

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Can anyone tell me why when I run this the output is not correct? It should be just a plain circle with pie slices....

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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;
}
 
Marshal
Posts: 79180
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please don't use two threads for the same problem. This is a continuation of this thread; please continue all discussion there.
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic