Highcharts在IE<=9和Chrome上刷新后失去了它的's dateRange值

Highcharts loses it's dateRange values after refresh on IE<=9 and Chrome

本文关键字:失去 dateRange IE Highcharts Chrome 刷新      更新时间:2023-09-26
var newCurrent = that.getIndexForCounter(that.currentPCData.CounterID, that.currentPCData.NetworkID);
                            if (currentIndex == newCurrent) {
                                $.each(model.Data, (j, point) => {
                                    if (!_.isNumber(j)) {
                                        return;
                                    }
                                    highChartInstance.series[0].addPoint(point, false, true);
                                });
                                highChartInstance.redraw();
                            }
                            that.currentPCData = that.allPCModels[newCurrent];

我使用这段代码来刷新我的Highcharts图表,当它第一次刷新时问题就出现了。1分钟数据范围和1天数据范围工作得很好,但1小时和2小时数据范围似乎被打破了,它们显示的时间间隔要小得多。最大的问题是,这个图表在Firefox和较新版本的Internet Explorer中工作得很好。用于选择日期范围的按钮的类型设置为"分钟",计数设置为"60"

使用moment.js解析Date值来解决。由于某些原因,默认日期解析在Chrome中不起作用