hi, i have some issues with SciChartScrollbar control. i’m trying to use it like in the Custom Overview demo, but with possibility to contol zoom programmatically (by keyboard). So i bound SciChartScrollbar control’s property
Axis ="{Binding ElementName =XAxis}"
where XAxis is the axis from the top chart
< s: SciChartSurface.XAxis >
< s: NumericAxis x: Name ="XAxis"
DrawMinorGridLines ="True"
DrawMinorTicks ="True">
</ s: NumericAxis >
</ s: SciChartSurface.XAxis >
and then i change VisibleRange of top chart from code behind (previously i tried this without Scrollbar.SelectedRange)
MainChartSurface.XAxis.VisibleRange.Min = Scrollbar.SelectedRange.Min = ((SpectraAnalysisTools )VM.AnalysisTools).ZoomMin;
MainChartSurface.XAxis.VisibleRange.Max = Scrollbar.SelectedRange.Max = ((SpectraAnalysisTools )VM.AnalysisTools).ZoomMax;
eventually the top chart’s zoom works perfect but the bottom scrollbar moves only first time when value changed and never more again.
So my question is – what should i do to make the scrollbar control (like in Custom Overview demo) working with controlling from codebehind?
- Yury Tolstoguzov asked 9 years ago
- You must login to post comments
i found that calling
OverviewSurface.InvalidateElement()
helps to solve the problem.
- Yury Tolstoguzov answered 9 years ago
-
Glad you found a solution. Another I was going to suggest is try XAxis.VisibleRange = new DoubleRange(min, max) (for NumericAxis), or XAxis.VisibleRange = new DateTimeRange(min, max) for DateTimeAxis. This will also trigger a redraw automatically. Best regards, Andrew
- You must login to post comments