I am have a vertical stacked chart setup which shares the same x- axis ranges. I am trying to find a way to add vertical lines in both the charts at once and further I need the vertical lines to be dragged in sync. When one vertical line annotation is dragged, I need the same movement to happen in the other chart as well. I can share a prototype if you want. Please suggest a solution.
- Biju Pillai asked 7 years ago
-
Hi Biju, provided that you have two SciChartSurfaces, you can simply have a binding between two annotations. Have you tried binding their X1 coordinates?
-
Thanks Yuriy. Already heading in that direction. But I see some performance issues when there are multiple synchronized lines in the charts. I am using a vertical slice modifier and the dragging of synchronized vertical lines are not as smooth as I would like.
- You must login to post comments
Hi Biju,
I’d like to see the code to give you some suggestions.
If you have two charts, you need two VerticalSliceModifiers (one in each chart) and two VerticalLines (one in each chart). the VerticalLineAnnotation.X1 should be bound to a common property in a ViewModel.
Performance problems could occur from a number of places, including:
- Number of vertical lines. Say you have hundreds of them and have to update them all
- Number of charts. Again say you have tens or hundreds of charts
- Binding errors. I don’t have your code so I don’t know if binding errors exist, but if they do, they will cause exceptions & slowdown
- How you perform the binding, for example RelativeSource FindAncestor bindings are a lot slower than simple Viewmodel TwoWay bindings.
Anyway send us some code and we can look into it! or, you can try profiling it yourself and looking for binding errors. Maybe you will discover something.
Best regards,
Andrew
- Andrew Burnett-Thompson answered 7 years ago
-
Thanks Andrew, I am using the same approach.One modifier per chart and new vertical lines which binds to the same property. This works and the performance problem I mentioned are while dragging the vertical lines in a synchronized manner. It takes a minor delay for the vertical lines to follow the mouse.It is not that much of a problem. I will investigate further and let you know if this bothers lot.
- You must login to post comments
Please login first to submit.