Page 1 of 1

Auto Fit issue

Posted: Fri Nov 20, 2020 12:26 pm
by giliweb
Hi, i just started using LightningChart and i'm really happy about it.
One thing i can't really figure out is how to limit the zooming out (with the mouse wheel) to fit the series data, so to not get empty areas before or after my series.
I tried the following, but it didn't seem to make any difference:

Code: Select all

const axisX = chart.getDefaultAxisX()
    .setAnimationScroll( false )
    .fit(false, true)
    .setChartInteractionFitByDrag(true)
    .setScrollStrategy(AxisScrollStrategies.fitting)
Can anyone help, please?
Capture.JPG
Capture.JPG (327.18 KiB) Viewed 15817 times

Re: Auto Fit issue

Posted: Thu Nov 26, 2020 11:00 am
by Arction_TerhoH
Hi!

We have a board dedicated to LightningChart JS here: viewforum.php?f=31
For future questions, I'd urge you to check this thread: viewtopic.php?f=31&t=2527

While there is no dedicated API to limit zooming out, you can accomplish this by using the Axis.onScaleChange() method.
This will allow you to subscribe to the scale change event, where you can check if the maximum zoom level has been achieved and set the interval to the value you want using Axis.setInterval()