0

I am trying to use live chart for wpf c#. Generally I got it to work to display a graph. However when i try to call the function below more than once it does not execute the second time. Why? If I restart the program it works but only the first time again. Anybody familiar with live charts (lvcharts) library and can give me some direction. Thank you!

public void FillTheGraph(string[] axisX, double[] axisY)
{

    SeriesCollection = new SeriesCollection
    {

        new LineSeries


        {
            Title = "Graph",

            Values = new ChartValues<double>(axisY)
        },
    };

    Labels = axisX;

    DataContext = this;
}
Mong Zhu
  • 23,309
  • 10
  • 44
  • 76
M. Levin
  • 163
  • 1
  • 11
  • how do you assert that it does not execute the second time? did you go through it with the debugger? does the graph disappear? What is your expected result when you execute it the second time, and what is the outcome? – Mong Zhu Nov 06 '16 at 22:01
  • I did some caveman debugging. I showed the message every time the function is executed and it worked. The messaged popped up but the graph did not change, but stayed the same – M. Levin Nov 06 '16 at 22:03
  • did you check whether you have different values for the Y-Axis on the second turn? That might be a reason why the graph did not change – Mong Zhu Nov 06 '16 at 23:03
  • Yes it is something to do with a library implementation i believe – M. Levin Nov 07 '16 at 04:43

0 Answers0