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 Jfreechart Pie chart Not refreshing with New dataset. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
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: 1083
    
  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.