简体   繁体   中英

Fit line chart In lighntingChart

I have line chart like below, Even when i use setInterval there is lots of padding in the top and bottom sometimes.How do I fit the visible line chart max and min to top and bottom of linechart inside the chart view.

在此处输入图像描述

在此处输入图像描述

In my line chart, my max is around 9345 and min is around 9332... but when I want to setinterval, I still see padding in top

axisY.setInterval(series.getYMin(),series.getYMax())

I even tried manually

axisY.setInterval(9332,9345)

But Still lots of padding in top of linechart, like in the image.

I solved it by storing the values in another array and slicing it to visible range..and getting min max like this

axisY.setScrollStrategy(undefined).setInterval(Math.min(...arr1),Math.max(...arr11))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM