Panning to the left zooms the XY chart

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
manawyddan
Posts: 3
Joined: Wed Oct 03, 2018 12:20 pm

Panning to the left zooms the XY chart

Post by manawyddan » Wed Oct 03, 2018 12:32 pm

Hi,

I am using LightningChartUltimate v7.2.1.4001 with WPF.

When I pan to the left (to see what's at the right of the view) and I reach the end of the series, the chart starts zooming in, instead of simply moving to the left.

Is it caused by some option I did not set in ZoomPanOptions or is it a normal feature, or is it a bug?

When panning to the left and reaching the end of the series, I expect the view to display nothing at the right of the chart, as it does when I zoom out.

Thanks for any help you can provide.

ArctionKestutis
Posts: 552
Joined: Mon Mar 14, 2016 9:22 am

Re: Panning to the left zooms the XY chart

Post by ArctionKestutis » Thu Oct 04, 2018 7:08 am

Hi,

For the start, you are using very old version. However, even in old version I don't recall such problem/bug. And definitely it is not the feature. Most likely some properties or event handler are set wrongly. It is difficult to say where you get it wrong without seeing code. Check our tutorials page and the code for Demo App examples. I would start checking that XAxis.ScrollMode is set to None.

And in any case it is better to upgrade to the latest LightningChart version, if you have valid subscription.

Hope this helps.

manawyddan
Posts: 3
Joined: Wed Oct 03, 2018 12:20 pm

Re: Panning to the left zooms the XY chart

Post by manawyddan » Tue Oct 23, 2018 8:37 am

Thanks for your great help.

I found why the chart control does that.

We were handling the RangeChanged event, to prevent the user from panning right at the beginning of the series or left at the end. And this event handler had a bug that made it possible to pan to the left when at the end of the series. We did not expect the chart to zoom-in when its width would grow, we expected the width not to grow at all.

What we want to do is for the axes to be at most 5% wider than the graph itself. To avoid losing sight of the graph, when zooming-out, we want it to be at most at 2.5% of its size from the border of the control. And also when panning in any direction (this is the reason why we tried handling the RangeChanged event in the first place).

How could we do that?

ArctionKestutis
Posts: 552
Joined: Mon Mar 14, 2016 9:22 am

Re: Panning to the left zooms the XY chart

Post by ArctionKestutis » Tue Oct 23, 2018 12:46 pm

LightningChart has a lot of events, which could be used to change the behavior of the Chart.
You may use XAxis.RangeChanged, YAxis.RangeChanged, ViewXY.BeforeZooming, ViewXY.Zoomed, ViewXY.BeforePanning and ViewXY.Panned events. I believe that with one or combination of event handlers you should be able to achieve the desired behavior.

All the best.

Post Reply