数据未显示时间戳值:高图

问题描述 投票:0回答:1

因此,我正在做的是将时间戳数据作为X轴,并将值作为Y轴。

但是出现问题是,虽然时间戳值未在控制台中显示,但数据仍未显示在图表上,而是显示在图表上。

数据值如下:

 var countArray = ["2020-14-03 11:14:48.225000","2020-14-03 11:14:48.226000","2020-14-03 11:14:48.227000","2020-14-03 11:14:48.228000","2020-14-03 11:14:48.229000","2020-14-03 11:14:48.230000","2020-14-03 11:14:48.231000","2020-14-03 11:14:48.232000","2020-14-03 11:14:48.233000","2020-14-03 11:14:48.234000","2020-14-03 11:14:48.235000","2020-14-03 11:14:48.236000","2020-14-03 11:14:48.237000","2020-14-03 11:14:48.238000","2020-14-03 11:14:48.239000","2020-14-03 11:14:48.240000","2020-14-03 11:14:48.241000","2020-14-03 11:14:48.242000","2020-14-03 11:14:48.243000","2020-14-03 11:14:48.244000"]; //X-axis Values

 var numArray = [2,5,3,6,4,6,3,6,3,6,3,7,3,6,3,5,3,5,6,3]  ; // Y-axis Values

这里是我正在尝试的小提琴。

https://jsfiddle.net/abnitchauhan/wq4na5fy/

主要问题是数据没有按照上面的值显示

javascript datetime highcharts timestamp
1个回答
0
投票

[您已将shift方法中的addPoint参数设置为true,这与空数据数组结合导致点不出现。

if (x > 1000) {
    series.addPoint([x, y], true, false, false);
}

实时演示: https://jsfiddle.net/BlackLabel/xhok1d6e/

API参考: https://api.highcharts.com/class-reference/Highcharts.Series#addPoint

© www.soinside.com 2019 - 2024. All rights reserved.