File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Dynamic chart in swing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
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: 244

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: 1096
    
  10

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: 244

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

Joined: Oct 16, 2003
Posts: 1096
    
  10

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: 244

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

Joined: Oct 16, 2003
Posts: 1096
    
  10

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: 244

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: http://aspose.com/file-tools
 
subject: Dynamic chart in swing