Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / November 2004

Tip: Looking for answers? Try searching our database.

Where to start/end (Charts)

Thread view: 
JS - 30 Nov 2004 08:10 GMT
I have tried to look in the sorce code for the JFreeChart charts to see if I
could find some help in making a chart. But I would like to get some of the
basics right on charts first.

My plan is to make the graph:

http://www.cis.ksu.edu/~schmidt/CIS200/gifV6html/Ch5/bargraph.gif

1) My first idea is to make the class:

class BarGraphWriter extends JPanel

2) The constructor method:

public BarGraphWriter( )

I will  use to make the frame where the graph is displayed.

3) Then I guess I need:

public void paintComponent(Graphics g)

as its my "pen" I write the info with

4) public void setAxes(int x_pos, int y_pos, String top_label, int y_height)

Is a method I need for defining the axes in the frame.

5)public void setBar1 - setBar6 (String label1-6, int height1-6, Color c1-6)

Is methods for each bar

6) In the end I will need:

class TestGraph
{ public static void main(String[] a)

where I enter different values for testing the graph.

Does this seem reasonable or should one start in another way?

JS
Mike B - 30 Nov 2004 08:49 GMT
> I have tried to look in the sorce code for the JFreeChart charts to
> see if I could find some help in making a chart. But I would like to
[quoted text clipped - 38 lines]
>
> Does this seem reasonable or should one start in another way?

What happens if you have 5 or 7 bars? Looks to me like you may need to
iterate over the bars rather than statically definining how many bars you
will have.

Signature

Mike B



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.