Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dynamic chart in swing

 
mallikarjun dontamsetti
Ranch Hand
Posts: 246
Firefox Browser Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1101
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
mallikarjun dontamsetti
Ranch Hand
Posts: 246
Firefox Browser Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it is a timeseries chart based on time it has to display values
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1101
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok fine, so what is the 'image' you are getting? I mean what is in the image?
 
mallikarjun dontamsetti
Ranch Hand
Posts: 246
Firefox Browser Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A graph which is not moving(not moving based on time) a static image.
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1101
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 246
Firefox Browser Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it is working fine when i do this


but my graph is showing a line in front how to remove it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic