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 Stackoverflow.com 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.

1
0

I attached a scrollbar to a Y axis, and it is functioning as expected except for how it handles VisibleRange.

If my code sets the Y Axis VisibleRange to be smaller than the min/max extent of the data series, the scrollbar behaves as expected – the size of the scrollbar decreases, and I can use it to pan through the full VisibleRange.

However, if I set the VisibleRange to be larger than the min/max extent of the data series, the scrollbar resets the VisibleRange to the actual data series extent as soon as I grab it.

Can I disable this behavior?

I would expect the scrollbar to navigate within the current VisibleRange, and not modify it.

This is using v3.21.0.5511

  • You must to post comments
0
0

Good question.

In my specific case, it would be least disruptive to the user if the VisibleRange is left unchanged, and the scrollbar extents are adjusted to fit the new VisibleRange if necessary. I can think of three scenarios:

  1. VisibleRange is changed (increased, decreased, moved), but still includes the full scrollbar extents : Scrollbar extents remain unchanged. Physically, the scrollbar shrinks, grows, and/or moves to reflect its proper size and position relative to the new visible range. This is the most common zoom-in/zoom-out or pan case

  2. VisibleRange is changed to be smaller than the current scrollbar extent: The scrollbar extent is set equal to the new VisibleRange. Scrollbar would span the full axis. This is also common for zoom-in

  3. VisibleRange is changed such that one end of the scrollbar or the entire scrollbar would be outside the new visible range: The range (max-min) of the Scrollbar extent remains the same (or is reduced to the new VisibleRange as in 2), but the max and min values are adjusted so the scrollbar is pegged at the appropriate end of the axis. This would normally be encountered during a pan.

In my case, I rely on the scrollbars for pan, so I would only encounter cases 1 and 2.

  • Daniel Hartl
    Number 1 sounds good. The Chartview (X-Axis) shouldn't get set back if I click on the Scrollbar...
  • You must to post comments
0
0

Hi there,

Thanks for your suggestions! We appreciate them and will consider when working on this issue.

Actually, this isn’t an easy issue to resolve. The reason is that a ScrollBar modifies the VisibleRange itself, and its maximum is bound to the DataRange + GrowBy. So I think we could either make the maximum of a ScrollBar configurable or just bound it to VisibleRangeLimit. Does this make sense?

As a workaround for now, I would suggest setting VisibleRangeLimit on the axis which a ScrollBar is bound to. Use a ValueConverter to apply GrowBy (if required):

            <sciChart:SciChartSurface.XAxis>
            <sciChart:NumericAxis VisibleRangeLimit="{Binding DataRange, Mode=OneWay, RelativeSource={RelativeSource Self}}" />
        </sciChart:SciChartSurface.XAxis>

This will prevent the main chart from zooming out of the DataRange along that axis.

Hope this helps!

Best regards,
Yuriy

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.