Hi,
I want to create a bar chart inside a JPanel for my Java application
(which is contained in a JFrame). The bar chart will simply create a
bar chart, showing values for 5 fields. These values will not be known
before the program is started.
Each bar which is drawn must have the ability to implement a
MouseListener so that when the user clicks on the bar, it will open up
another frame.
What would be the best method to do this? Are there classes in the
javax.swing package that will allow me to do this, or do I have to use
those in the AWT package? I'm new to GUI's so I'm not sure which is
best to use?
Cheers,
Dave
Jaume - 04 Dec 2003 22:23 GMT
look at RChart, the source code is available at a very low cost:
http://www.java4less.com/charts_e.htm
> Hi,
> I want to create a bar chart inside a JPanel for my Java application
[quoted text clipped - 13 lines]
> Cheers,
> Dave
Erik Mautsch - 23 Dec 2003 09:11 GMT
> What would be the best method to do this? Are there classes in the
> javax.swing package that will allow me to do this, or do I have to use
[quoted text clipped - 3 lines]
> Cheers,
> Dave
http://www.jfree.org/jfreechart/index.html
You can generate your chart by hardcoded values / or by values from a
database.
I tried both of them.
HTH
Regards
Erik