Pre loader

Zoom and Pan

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 all,

  1. How to find out chart’s zoom percentage (chart has multiple X and multiple Y axes.)?
  2. How can I programmatically pan a linear chart, which have a point outside of a visible range?
  3. How can I check is the point outside of a visible range?

Thanks,
Arthur

  • You must to post comments
0
0

Hi Arthur,

Regarding the first question, I’m not sure it is reasonable in the case of multiple axes, because each axis can have it’s own zoom level unless they all have the same data extents and shared VisibleRanges. We are going to introduce the ScaleFactor property in next version, which will allow to control zoom scale on an axis. Is it applicable in your case? Could you provide us with more detailed explanation on what you want to achieve? We can consider it as a use-case then.

You can programmatically pan the chart using Scroll…() methods on axes(modifiers call them internally), please, refer to Axis Interactivity (Zoom, Scroll, Pan Programmatically) for more info.

Concerning the third, do you mean a data point or pixel coordinates? In the first case, just check if X and Y lies inside the VisibleRange. In the second, you need to convert them to chart coords using convertion API, the easiest way is via the IAxis.GetDataValue(..) method. Please, let me know and I will point you to some threads.

Hope the above helps!

Best regards,
Yuriy

  • Arthur Romanov
    Hi Yuriy, 1. I should to save chart zoom and restore it after load. I'm saving the chart with the single X and Y Axis(save VisibleRange (XMin/XMax, YMin/YMax)) and it's working fine. But when I have multiple x/y axes I dont know what can I do. I think I can convert min max into points and make zoom, but I don't know, how. 3. But, when the point is outside of the VisibleRange, how can I move it to center of the chart Visible range? Thanks, Arthur
  • Yuriy Zadereckiy
    Hi Arthur, There is the IAxis.Id property, you should save it as well in the case of multiple axes. If you deal with axes of different types, you need to save its type also. VisibleRange.Min/Max can be converted to doubles and then restored corresponding to the axis type. Then just need to apply it - or am I missing something? Does this make sense for you? By the way, we are going to provide built-in feature for saving/restoring chart data to/from XML in next version. It's under testing now and hopefully will be out in early February. Regarding the second question, you need to do some calculations here. There is API for scrolling the chart as well as for converting data points to pixels and vice versa. The two methods seems to be applicable in this case, IAxis.Scroll(pixels) and IAxis.ScrollBy(points). So you need to calculate how many data points or pixels you need to scroll the chart by, you can use IAxis.GetDataValue(pixels) and IAxis.GetCoordinate(dataValue) for conversion. Hope this helps! Best regards, Yuriy
  • Arthur Romanov
    Hi Yuriy, Thanks!!! Best regards, Arthur
  • 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