• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating a Pie Chart

 
Rafiq Delawala
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
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • 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

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic