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

0
0

Hi,

I have graphs with VisibleRange set in both axes (Y and X). The way I would like my graphs to behave is as follows:

  1. When the graph is loaded, the VisibleRanges are applied in both axes.
  2. When I zoom, ZoomExtents applies to both axes
  3. When I double click on the graph to restore, the initial VisibleRanges as in (1) applies.

NB:
– I set the VisibleRange by Binding
– One of the graphs has a Logarithmic XAxis (Just incase it has a special treatment)
– Currently my graphs set VisibleRanges correctly at first, but not after zoom and restore.

Help me out with how to proceed, please.

Thanks in advance.

Kilosa M.

  • You must to post comments
0
0

Hi Kilosa,

Thanks for your request. There are two ways of implementing the desired behavior for now:

  • you could extend ZoomExtentsModifier and override its default behavior. Please take a look at the example provided by another user in this thread.

  • if you want to override the default AutoRange behavior completely, you should create your own implementation of ViewportManager.

Please let us know if you need more assistance with this,

Best regards,
Yuriy

  • You must to post comments
0
0

“Currently my graphs set VisibleRanges correctly at first, but not after zoom and restore.”

This usually occurs because you have a Binding to VisibleRange, but have not used a TwoWay binding.

please see A Note about DependencyProperty Precedence for info.

“Internally, SciChart sets the AxisBase.VisibleRangeProperty using the Local Value precedence in some places. We must do this as ChartModifiers, and AutoRange need to update the AxisBase.VisibleRange.”

“This means that in some cases, style setters and templated properties setting Axis.VisibleRange will not appear to work. For this reason we recommend that any bindings to VisibleRange are a TwoWay binding to a ViewModel property:”

Let me know if this helps

  • Kilosa Magali
    Hi Andrew, I had TwoWay binding already set. I’ll try to check with Yuriy’s solution. But if there’s a simpler alternative I will be glad.
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.