Auto Fit issue

Not familiar with licensing? Need help in installing LightningChart Ultimate SDK? User's manual is missing? Post general questions here.

Moderator: Queue Moderators

Post Reply
giliweb
Posts: 1
Joined: Fri Nov 20, 2020 11:17 am

Auto Fit issue

Post by giliweb » Fri Nov 20, 2020 12:26 pm

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 15827 times

Arction_TerhoH
Posts: 2
Joined: Thu May 28, 2020 6:36 am

Re: Auto Fit issue

Post by Arction_TerhoH » Thu Nov 26, 2020 11:00 am

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()

Post Reply