title: Updating JFreechart dataset with timer
body: <p>I found an example about multiple charts <a href="https://stackoverflow.com/questions/15805536/jfreechart-how-do-you-put-multiple-charts-into-a-composite-chart">here</a>, and try to improve it a little bit. I want these values to be changed with time.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>import java.awt.Color;
  import java.awt.EventQueue;
  import java.awt.GridLayout;
  import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
  import javax.swing.JFrame;
  import javax.swing.JPanel;
  import javax.swing.Timer;
  import org.jfree.chart.ChartPanel;
  import org.jfree.chart.JFreeChart;
  import org.jfree.chart.plot.ThermometerPlot;
  import org.jfree.data.general.DefaultValueDataset;
  import org.jfree.data.time.Second;
  import org.jfree.data.time.TimePeriod;
  import org.jfree.ui.RefineryUtilities;
  
  /**
   *
   * @author AloneInTheDark
   */
  public class ThermometerDemo extends JPanel {
  
      private static final int W = 200;
      private static final int H = 2 * W;
  private static Timer timer;
  int artan=0;
  double VALUE;
  int FAST=1000;
    DefaultValueDataset dataset ;
      public ThermometerDemo(double value) {
          this.setLayout(new GridLayout());
          VALUE=value;   
  
  
              timer = new Timer(FAST, new ActionListener() {
              @Override
              public void actionPerformed(ActionEvent e) {
          artan++;
              }});
  
             dataset = new DefaultValueDataset(VALUE+artan);
          ThermometerPlot plot = new ThermometerPlot(dataset);
          plot.setSubrangePaint(0, Color.green.darker());
          plot.setSubrangePaint(1, Color.orange);
          plot.setSubrangePaint(2, Color.red.darker());
          JFreeChart chart = new JFreeChart("Demo",
              JFreeChart.DEFAULT_TITLE_FONT, plot, true);
          this.add(new ChartPanel(chart, W, H, W, H, W, H,
              false, true, true, true, true, true));
      }
     public static void start() {
          timer.start();
      }
  
  
      public static void main(final String[] args) {
  
          EventQueue.invokeLater(new Runnable() {
  
              @Override
              public void run() {
                   final JFrame f = new JFrame("Demo");            
                  f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                  f.setLayout(new GridLayout(1, 0));
                  f.add(new ThermometerDemo(40));
                  f.add(new ThermometerDemo(60));
                  f.add(new ThermometerDemo(80));
                  timer = new Timer(1000, new ActionListener() {
  
              @Override
              public void actionPerformed(ActionEvent e) {
                  f.repaint();
              }});
                  f.pack();
                  f.setVisible(true);
  
          start();
  
              }
          });
  
      }
  
  }
  </code></pre>
  
  <p>When i debug this project, the timer works, my "artan" variable is growing each second but nothing changes in charts. The values in thermometers does not change. How can i solve this?</p>
  
  <p><strong>EDIT</strong>: When i put this line into timer, there is no values inside charts:
      dataset = new DefaultValueDataset(VALUE+artan);</p>