SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on where you can earn rep for your questions!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.

Answered Closed

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?

  • You must to post comments
Great Answer

i found that calling
helps to solve the problem.

  • Andrew
    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 to post comments
Showing 1 result