I am using FastLineRenderableSeries with DateTimeAxis for X-axis.
And, I’m using mouse event to get X-axis value use clicked by mouse.
I’m using code below.
Put vertical line at chart where nearest X value exists, when mouse button clicked
But sometimes MouseButtonEventArgs.GetPosition takes time.
Code like this.
private void chartSurface_PreviewMouseDown(object sender, MouseButtonEventArgs e)
{
if (isInitialized == false) return;
PerformanceAnalyzer.Start("chartSurface_PreviewMouseDown");
// Get mouse point
var mousePoint = e.GetPosition(chartSurface);
PerformanceAnalyzer.Check("e.GetPosition(chartSurface)");
}
Normally.
Performance analyze start:2021/09/09 10:55:47 chartSurface_PreviewMouseDown
Performance analyze check:2021/09/09 10:55:47 elapsed:00:00:00.0027280 e.GetPosition(chartSurface)
When slow
Performance analyze start:2021/09/09 10:55:48 chartSurface_PreviewMouseDown
Performance analyze check:2021/09/09 10:55:48 elapsed:00:00:00.4303424 e.GetPosition(chartSurface)
Is there any good way to get more good and stable performance?
- Hiroyuki Seki asked 3 years ago
- last edited 3 years ago
- You must login to post comments
Hi Hiroyuki,
MouseButtonEventArgs.GetPosition(e) is a WPF / C# call, and nothing to do with SciChart, if this is taking time I can only suggest to run a performance profiler on your application and try to see where the time is being spent. Is it in the WPF framework? Or somewhere else blocking the UI thread?
Also have you seen our ChartModifier API? You can create behaviours to tag onto charts. We already handle mouse down and mouse move events for you. You can interact with the chart by creating a custom modifier.
Learn more about this API here:
- Andrew Burnett-Thompson answered 3 years ago
- You must login to post comments
Please login first to submit.