This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Jfreechart Pie chart Not refreshing with New dataset. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Jfreechart Pie chart Not refreshing with New dataset." Watch "Jfreechart Pie chart Not refreshing with New dataset." New topic
Author

Jfreechart Pie chart Not refreshing with New dataset.

Stanley Mungai
Ranch Hand

Joined: Dec 09, 2011
Posts: 155

Hello friends, I have this Piedataset that I am creating from an Oracle database Like this:



I also have a JList on the same Screen that I have Rendered to Checkboxes and I have added a ListSelectionListener



I need the Pie chart to refresh with the New Values say if I click on one checkbox the dataset should change But My Pie chart is not refreshing. Wgat could I be doing wrong? I will appreciate example too.


Give a beggar a fish; feed him for a day. Teach him how to fish; Feed him for a lifetime.
Richard Tookey
Ranch Hand

Joined: Aug 27, 2012
Posts: 1035
    
  10

Think about this fragment of your code -


1) Each call to createDataset() creates a new dataset which you do nothing with! You need to use it to update your chart.
2) If an exception is thrown you just ignore it.

Stanley Mungai
Ranch Hand

Joined: Dec 09, 2011
Posts: 155

Ok Got it thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jfreechart Pie chart Not refreshing with New dataset.
 
Similar Threads
Autoupdating Pie Chart with jFreeChart
Need to hide borders for a barchart generated with Jfree chart except x and y axis
Problem in displaying waterfall chart with -ve values
How to connect a JPanel created by JFreeChart to JFrame