Meaningless Drivel is fun!*
The moose likes Swing / AWT / SWT and the fly likes Autoupdating Pie Chart with jFreeChart Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Autoupdating Pie Chart with jFreeChart" Watch "Autoupdating Pie Chart with jFreeChart" New topic
Author

Autoupdating Pie Chart with jFreeChart

Jesse Miller
Ranch Hand

Joined: Apr 05, 2010
Posts: 37
So I just discovered jFreeChart and ive been playing around with it. I am creating a PieChart that pulls information from a web service to get its data. I would like to update this chart every minute by calling the web service again and changing the dataset values. I know that once the dataset values are changed the action listener on the Pie Chart will automatically update the chart. Ive included my code, can anyone tell me how to best implement this timer? Thanks

Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
This may help: http://www.java2s.com/Code/Java/Chart/JFreeChartBubblyBubblesDemo.htm
Jesse Miller
Ranch Hand

Joined: Apr 05, 2010
Posts: 37
ok, but how do I update the dataset? I see that the Series has an update function but I dont know of anything like this for a piechart dataset.
Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
I'd guess that calling setValue with the same keys but different values would replace the previous values.
 
 
subject: Autoupdating Pie Chart with jFreeChart
 
Similar Threads
Any1 know drawin pie chart using jfreechart
I am not able to display panel in my applet by embedding applet in html. Please help.
Any1 know drawin pie chart using jfreechart
running applet through JSP
showing applet embedded in jsp