Pre loader

Scrollbar minimum thumb size

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

Hi,

Having solved my issue with hiding the zoom grips on the scrollbar (and adding a rubber ducky to my shopping list), I am now facing another issue for which I am not certain I can find the solution.

The thumb on the scrollbar only goes so small. It’s width (on the X Axis) only goes so low. The problem is that I can’t zoom in effectively, because the VisibleRange appears to be bound proportionately to the width of the thumb. As an example, I have a 30 minute file of data at 5120 Hz to display. The initial zoom level should be 1 second, and I set it like this:

 VisibleSeconds = 1;
 VisibleX = new DateRange(TimeDomainFile.StartTime, TimeDomainFile.StartTime.AddSeconds(VisibleSeconds));

This produces the correct view at first (see image attached). But then, when I drag the scroll Thumb, and drag it back, the Zoom size has increased (see other image attached). In this case, it went to 12.7794 seconds of display, but that could be different based on the size of the window at the time. Again, I think I understand the reason for this — the move of the thumb triggers a recalculation of the VisualRange, and uses the thumb’s current width to calc from.

I found a solution that got me close, but there are a couple of problems. First the Solution, in my ViewModel:

  public void OnVisibleSecondsChanged()
  {
        VisibleTicks = (long)(VisibleSeconds * 10000000);
  }

  using (_chartSuspendable.SuspendUpdates())
  {
        if (VisibleX.Diff.Ticks > VisibleTicks)
        {
              VisibleX = new DateRange(VisibleX.Min, VisibleX.Min.AddTicks(VisibleTicks));
              return;
        }

        foreach (var vm in TimeDomainData)
        {
              ((ChannelViewModel)vm).UpdateData(VisibleX);
        }
  }

Next, the issues. First, even with the SuspendUpdates call, there is a screen flicker as the data goes from one zoom level to another. In addition, I am never able to get the right most data to display.

So, I suppose I am asking whether there is some setting or something that will allow the SciChartScrollbar to be used as only a positional pointer, and not be used for range width (zoom level) as well. Or at the very least, to take on this behavior when the Thumb has reached the MinWidth size…

Incidentally, I was able to reproduce the issue on your Load 1 Million Data points demo by adding a scrollbar to the X Axis, hiding the grips, and then at runtime zoom with the RubberBand Zoom tool down to about 5 points in scope. When you drag the scrollbar thumb, you see the behavior.

Thanks in advance,
Mike.

Version
4.0.6.8578
Images
  • You must to post comments
0
0

You can improve the situation somewhat by using the SciChartScrollBar.ZoomLimit property.

Set this to a really low value, e.g. 1 pixel, and you can drag the scrollbars closer together.

But you’re right, once we get down to this level we really have hit the limit of number of pixels on the screen, so at this level of zoom the scrollbar can only be used as a positional pointer.

Give that a try, let us know if it helps.

Best regards,
Andrew

  • Michael Dusoe
    Not quite, but closer :) The issue of not allowing zoom to go closer still exists – I set the initial zoom to 1 second, and dragging the bar makes the new range ~1.4 seconds. Unfortunately, we will need to zoom in to the 3-4 sample level, well below one second. In addition, the new issue this approach creates (as expected) is that the thumb is too small to see. Can you suggest an approach that uses a WPF ScrollBar or something else? Or would you be willing to add a “AllowZoom” property to the scrollbar?
  • Andrew Burnett-Thompson
    Hi Michael, Scrollbars in general are not suited for such a fine grain of zooming. Given a chart width of 1,000 pixels, a 1 pixel scrollbar move adjusts the zoom by 0.1% on the parent chart. So if you want to adjust in finer increments: 0.05% or 0.01%, you cannot use a scrollbar.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies