Zooming out beyond extents of data in viewXY

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Arction_LasseP

symbolick
Posts: 49
Joined: Thu May 16, 2013 8:24 pm

Zooming out beyond extents of data in viewXY

Post by symbolick » Thu May 16, 2013 8:35 pm

Hello,
My problem is that the chart seems to allow users to zoom out to levels that make the chart unusable.
I am using a viewXY chart to display some data. I have the autoYfit enabled which is partially solving my problem of users being able to zoom out into infinity where the data as no longer visible. However the Xaxis does not seem to have any of the same functionality, Is there any simple ways to take care of this problem or should I attach a event handler to some event handler that fires when the zoom level is changed that will check each point?

Regards,
Aaron

User avatar
ArctionPasi
Posts: 1365
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland

Re: Zooming out beyond extents of data in viewXY

Post by ArctionPasi » Thu May 16, 2013 8:58 pm

Hi Aaron,

You can limit the zooming in RangeChanged event handlers of X and Y axes.

Several series types have Statistics property which usually indicates the XMin, XMax, YMin and YMax values. They provide quickly the info without having to iterate through series points. Statistics may not be available in all real-time monitoring scenarios however, and then iterating the points is necessary.

Other handy way is to call ViewXY.FitView(). That will fit both X and Y axes to data contents. Y axes have Fit method by them selves, separately, and you can supply also margin value in pixels or percents.

To set a preferred range for X or Y axis, call axis.SetRange(min, max).

Please let me know if you need more info on this subject. ;)
LightningChart Support Team, PT

symbolick
Posts: 49
Joined: Thu May 16, 2013 8:24 pm

Re: Zooming out beyond extents of data in viewXY

Post by symbolick » Thu May 16, 2013 9:30 pm

Works great, thank you.