This week's book giveaway is in the General Computing forum.
We're giving away four copies of Emmy in the Key of Code and have Aimee Lucido on-line!
See this thread for details.
Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • Post Reply 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Creating a Pie Chart

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you go about creating a piechart that will read a data file that contains a title and a series of numbers, and plots this as as a coloured pie chart in a window.
The data file should consist of a single line of text containing the label for the chart. Each subsequent line
should consist of a numeric data point (which may be either an integer or a floating point value), and there
may be any number of data points. The program should create a window, write the label of the chart into
that window and draw the pie chart. Each segment of the pie chart should be a different colour.
Two
sample data files together with the output produced is shown below.
First Data Set
14
12
37
62
The second data set
0.3
0.2
0.07
0.07
0.09
0.5
0.3
also the following will also be needed
1. Add a set of menus to the program window, and allow it to read the data file by selecting a
�File/Open� menu command.
2. Add labels for the segments to the data file, and draw theses on the chart on top of (or next to) pie segments.

I think a I/O class is required for the data reading, but i dont know how to implement this
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a discussion going on at http://www.javaranch.com/ubb/Forum33/HTML/004093.html on that topic
HIH
------------------
Valentin Crettaz
Sun Certified Programmer for Java 2 Platform
 
Rafiq Delawala
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

thanks for the response, but i was hoping for a source code for the instructions send in the my orignal reply

Originally posted by Valentin Crettaz:
There is a discussion going on at http://www.javaranch.com/ubb/Forum33/HTML/004093.html on that topic
HIH


 
There are 10 kinds of people in this world. Those that understand binary get this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!