jQuery in Action, 2nd edition
The moose likes Swing / AWT / SWT and the fly likes Dynamic chart in swing Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "Dynamic chart in swing" Watch "Dynamic chart in swing" New topic
Author

Dynamic chart in swing

mallikarjun dontamsetti
Ranch Hand

Joined: Mar 18, 2011
Posts: 231

Hi i am in a project, my task is applet calling a swing application. In swing frame i have a dynamic time series chart. has to display with some random data. ihave developed chart in jfreechart. when i try to add that chart to my panel it is not working as i anticipated. my code is.

// chart class



getChartPanel methode will return the panel which i have to add in my main frame.

//My panel


This panel will be added to a Jframe.

but the graph is not moving. it is constantly displaying an image.
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 914
    
    2

mallikarjun dontamsetti wrote:but the graph is not moving. it is constantly displaying an image.


what do you mean by graph not moving? by image do you mean the chart being generated?
As far as I know, JFreeChart will generate the image and you can show that in your app. It doesn't support animation. If you need charts with animation, you should look at JavaFX charts.


Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
mallikarjun dontamsetti
Ranch Hand

Joined: Mar 18, 2011
Posts: 231

it is a timeseries chart based on time it has to display values
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 914
    
    2

ok fine, so what is the 'image' you are getting? I mean what is in the image?
mallikarjun dontamsetti
Ranch Hand

Joined: Mar 18, 2011
Posts: 231

A graph which is not moving(not moving based on time) a static image.
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 914
    
    2

You will have to provide a SSCCE to move further. Also, mention the JFreeChart version...

Edit: Ok, now I see what you are saying - the code has a timer which moves the time...this is something I am not aware of...
mallikarjun dontamsetti
Ranch Hand

Joined: Mar 18, 2011
Posts: 231

it is working fine when i do this


but my graph is showing a line in front how to remove it.
 
I agree. Here's the link: jrebel
 
subject: Dynamic chart in swing
 
Similar Threads
problem in displaying text in item label in JFreeChart
Autoupdating Pie Chart with jFreeChart
how do i get plot x Axis every 5 minute (JFreechart)
Displaying scalable vector graphics on ibm aix
java JFreechart compress the line over the time period