Win a copy of Murach's MySQL this week in the JDBC and Relational Databases forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Creating charts

 
Ranch Hand
Posts: 70
Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Shikha Upadhyaya
Ranch Hand
Posts: 70
Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Saloon Keeper
Posts: 7573
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic