简体   繁体   English

在 lighntingChart 中拟合折线图

[英]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.我有如下折线图,即使我使用 setInterval,有时顶部和底部也会有很多填充。如何将可见折线图的最大值和最小值拟合到图表视图中折线图的顶部和底部。

在此处输入图像描述

在此处输入图像描述

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在我的折线图中,我的最大值在 9345 左右,最小值在 9332 左右......但是当我想设置间隔时,我仍然在顶部看到填充

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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