【发布时间】:2016-09-14 13:32:43
【问题描述】:
请注意,在我的屏幕截图中,工具提示显示的是正确的当地时间。但是 xAxis 时间线显示的是 UTC 时间下午 12:00。
我在 2 个地方将 global:useUTC 设置为 false:
在我的图表配置中:
vm.config = {
global: { useUTC : false }, // <--
options: {
// ....
以及在加载图表后运行的 setHighCharts 函数:
const setHighChartOptions = (color, background, gridLine) => {
Highcharts.setOptions({
global: { useUTC: false }, // <--
chart: {
backgroundColor: background
},
legend: {
itemStyle: { color: color }
},
loading: {
labelStyle: { color: color },
style: { backgroundColor: background }
},
xAxis: { labels: {style: { color: color }}}
});
chart.get('y-axis-price').update({
gridLineColor: gridLine,
gridLineDashStyle: 'longdash'
}, false);
chart.get('x-axis-sentiment').update({
tickColor: background
}, false);
chart.get('x-axis-alert').update({
tickColor: background
}, false);
};
我缺少什么吗? :(
【问题讨论】:
标签: javascript charts highcharts utc timeline