3

I am using LiveCharts.WinForms.CartesianChart to render a large amount of points:

myChart.Zoom = ZoomingOptions.X;
myChart.Pan = PanningOptions.X;

myChart.Series.Add(new LineSeries
{
    Values = chartValuesScores,
    Fill = System.Windows.Media.Brushes.Transparent,
    PointGeometrySize = 5
});
myChart.AxisX.Add(new Axis
{
    Labels = labels
});

What I want to do is to display some kind of a progressbar and stop the time LiveCharts needs to render this points. But it seems that LiveCharts renders the points asynchronously. That means that after running the code above, it continues running other code lines and exits the function. Thus, my question is: Is there a way to detect that LiveCharts.WinForms.CartesianChart is finished with rendering? I could not find an event or something else.

Code Pope
  • 5,075
  • 8
  • 26
  • 68

2 Answers2

0

I found this while checking the docs: https://lvcharts.net/App/examples/v1/wpf/Events

It lists Chart.UpdaterTick as one of the events. That events seems to fire when the graph has finished loading the data and had rendered it on screen, I believe what you were looking for?

I've tested myself and appears to work as I expect.

Dan Rayson
  • 1,315
  • 1
  • 14
  • 37
-1

There is an CartesianChart.Loaded event, which is fired after the chart is rendered.

myChart.Loaded += myChart_Loaded;

private void myChart_Loaded(object sender, RoutedEventArgs e)
{
    // chart is rendered
}
Filip
  • 1