title: How do I correctly update my chart values? (In real time)
body: <p>I recently encountered a tool called LiveChart and decided to test it out.</p>
  
  <p>Unfortunately I've been having some problems figuring out how to update the chart values in real time. I'm pretty sure there's a clean and correct way of doing it, but I can't seam to find it.  </p>
  
  <p>I would like to be able to update the values through a <code>private void</code> or button.</p>
  
  <p>In my code I'm testing it out with a ToolStripMenu.</p>
  
  <p>[CODE]:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Windows.Forms;
  using LiveCharts;
  using LiveCharts.WinForms;
  using LiveCharts.Wpf;
  using PokeShowdown_AccStats_T.Properties;
  using LiveCharts.Defaults;
  
  namespace PokeShowdown_AccStats_T
  {
      public partial class Form1 : Form
      {
          public Form1()
          {
              InitializeComponent();
  
              //int val1 = int.Parse(Settings.Default.Value1);
  
              var value1 = new ObservableValue(3);
              var value2 = new ObservableValue(7);
              var value3 = new ObservableValue(10);
              var value4 = new ObservableValue(2);
  
              //value1.Value = 5;
  
              cartesianChart1.Series.Add(new LineSeries 
              {
                  Values = new ChartValues&lt;ObservableValue&gt; { value1, value2, value3, value4 },
                  StrokeThickness = 4,
                  StrokeDashArray = new System.Windows.Media.DoubleCollection(20),
                  Stroke = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb(107, 185, 69)),
                  Fill = System.Windows.Media.Brushes.Transparent,
                  LineSmoothness = 0,
                  PointGeometry = null
              });
  
  
  
              cartesianChart1.Background = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb(34, 46, 49));
  
              cartesianChart1.AxisX.Add(new Axis
              {
                  IsMerged = true,
                  Separator = new Separator
                  {
                      StrokeThickness = 1,
                      StrokeDashArray = new System.Windows.Media.DoubleCollection(2),
                      Stroke = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb(64, 79, 86))
                  }
              });
              cartesianChart1.AxisY.Add(new Axis
              {
                  IsMerged = true,
                  Separator = new Separator
                  {
                      StrokeThickness = 1.5,
                      StrokeDashArray = new System.Windows.Media.DoubleCollection(4),
                      Stroke = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb(64, 79, 86))
                  }
              });
          }
  
          private void Form1_Load(object sender, EventArgs e)
          {
  
          }
  
          private void changeValue1ToolStripMenuItem_Click(object sender, EventArgs e)
          {
              Settings.Default.Value1 = "10";
              Settings.Default.Save();
              this.Text = Settings.Default.Value1;
  
          }
  
          private void changeValue1To3ToolStripMenuItem_Click(object sender, EventArgs e)
          {
              Settings.Default.Value1 = "3";
              Settings.Default.Save();
              this.Text = Settings.Default.Value1;
  
          }
      }
  }
  </code></pre>