This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Creating charts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Creating charts" Watch "Creating charts" New topic
Author

Creating charts

Shikha Upadhyaya
Ranch Hand

Joined: Aug 17, 2011
Posts: 70

I have a log file freelast.txt as shown below:

I have to plot the values corresponding to Mem, Swap and Total in a chart (pie chart or bar graph). In my work so far I have been able to retrieve all the numerical values and store them in 3 arrays respectively. My question is whether JFreeChart is a suitable library to do this? How do I start off?
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3071
    
  33

I am not sure if you can use JFreeChart in a Swing application. Please verify that.
Otherwise JavaFX 2 has support for charts and you can embed them into your swing applications.
Read this for JavaFX 2 chart tutorial
Read this for integrating javafx scene into swing.

Mohamed Sanaulla | My Blog
Shikha Upadhyaya
Ranch Hand

Joined: Aug 17, 2011
Posts: 70

Mohamed Sanaulla wrote:I am not sure if you can use JFreeChart in a Swing application. Please verify that.
Otherwise JavaFX 2 has support for charts and you can embed them into your swing applications.
Read this for JavaFX 2 chart tutorial
Read this for integrating javafx scene into swing.


I have jdk 1.7.0 installed currently. Do I have to install javafx 2 in order to use this now?
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3071
    
  33

Shikha Upadhyaya wrote:
Mohamed Sanaulla wrote:I am not sure if you can use JFreeChart in a Swing application. Please verify that.
Otherwise JavaFX 2 has support for charts and you can embed them into your swing applications.
Read this for JavaFX 2 chart tutorial
Read this for integrating javafx scene into swing.


I have jdk 1.7.0 installed currently. Do I have to install javafx 2 in order to use this now?

Yes you need the javaFX 2 SDK
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
There's no problem with using JFreeChart in a Swing app; it can either create static images that you can display (PNG, JPEG), and it also has a Swing component for displaying images directly.

Or you can use something like http://jchart2d.sourceforge.net/ for dynamic chart display.
 
 
subject: Creating charts