aspose file tools*
The moose likes Java in General and the fly likes Creating a Pie Chart Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Creating a Pie Chart" Watch "Creating a Pie Chart" New topic
Author

Creating a Pie Chart

Rafiq Delawala
Greenhorn

Joined: Nov 21, 2001
Posts: 3
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

Joined: Aug 26, 2001
Posts: 7610
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


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
Rafiq Delawala
Greenhorn

Joined: Nov 21, 2001
Posts: 3

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

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Creating a Pie Chart