Pre loader

Single Axis ZoomExtents and scaling

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,
I need to display a chart with a fixed X axis, i.e. with the scale remaining fixed between 0 and 360 with these end values displayed. I have set this in XAML with the SciChartSurface.AutoRangeOnStartup False and implemented InvalidateParentSurface(RangeMode.ZoomToFitY) after drawing the chart but unless the data fills the chart the end values on the scale are not displayed. If I set the VisibleRange to -5, 365 and stretch the chart in the X plane the 360 then the 0 appear, see attached sample.

If I increase the scale values significantly or have large GrowBy values the end values are displayed but this can be messy, depending on the data and leaves large blank areas at each end of the chart. Is there a way round this or should I implement a ZoomExtentsModifier to handle this?

Am I right in thinking that I will need to implement a ZoomExtentsModifier anyway to get this functionality when the user double clicks the chart to zoom extents?

I am using SciChart v1.6.0.2295 Hotfix.

Many Thanks
Dai

Attachments
  • You must to post comments
0
0

Hi Dai,

Regarding zoom extents behavior to particular bounds, there are several ways to achieve this. You can create custom modifier(or extend existing ZoomExtentsModifier as you mentioned) and put logic which you need here, or you can apply your own ViewportManager to the surface, as described in this post:Zoom including annotations. This feature is designed exactly for such situations.

Concerning first/last values of the scale, this is current axis implementation, we prevent them from being showed deliberately. You could take a look at this topic Setting range and ticks for more info. But there is a workaround, please, take a look at our Drag axis to scale example – notice, that first/last ticks are added manually, so you can add two TextBlocks and bind them to VisibleRange.Min,Max correspondingly.

Hope this helps! Please, feel free to ask if you have more questions or need any assistance with implementation.

Best regards,
Yuriy

  • Dai
    • Dai
    • 11 years ago
    Great thanks, i'll have a look through those examples. Dai
  • Dai
    • Dai
    • 11 years ago
    Hi Again, As you say I can modify the xAxis range by creating a ViewportManager which works when the chart is displayed but I can't find a simple way of not changing the xAxis range when the RubberBandXyModifier is zooming. Will I have to create my own RubberBandXyModifier, override OnMouseDown/Up and communicate the new xAxis range to my ViewportManager or is there a simpler way. Thanks Dai
  • Yuriy Zadereckiy
    Hi there, Which behavior would you want to see instead of zooming the chart? Do you want to select points using RubberBandZoom modifier? Please, clarify at this or post some screenshots here displaying that you want to achieve. Best regards, Yuriy
  • Dai
    • Dai
    • 11 years ago
    Hi, I need the chart to show the full X axis when it is first displayed or zoomed out (ZoomExtentxY) with the outer scale values, 0 and 360 shown, but when the XyRubberBandZoomModifier is used to zoom in I want the chart to zoom normally. That is with the normal RubberBandModifier functionality where the X axix is also zoomed. I can get the chart to show the whole X axix scale when it is displayed using the ViewportManager but this then interferes with the required RunnerBandModifier function. Hope this makes sense, screenshots attached.. Thanks Dai
  • You must to post comments
0
0

Hi again,

I think the easiest way to achieve this is to inherit your ViewportManager from existing DefaultViewportManager and catch VisibleRange changes in OnVisibleRangeChanged(..) method. So, if the chart is zoomed in, you need to call base(default) implementation and if it’s zoomed out, call your own.

Does this make sense in your case?

Best regards,
Yuriy

  • Dai
    • Dai
    • 11 years ago
    Hi, Thanks, that sounds like it should work and is a much simpler solution. Much appreciated Dai
  • You must to post comments
Showing 2 results
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