This week's book giveaway is in the Java in General forum.
We're giving away four copies of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 and have ishori Sharan & Adam L Davis on-line!
See this thread for details.
Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

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: 7236
169
  • 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.
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic