gpt4 book ai didi

javascript - 带有日期点Start的 Highcharts 区域

转载 作者:行者123 更新时间:2023-12-02 23:19:43 24 4
gpt4 key购买 nike

我正在尝试构建一个包含单个数据系列和日期点开始的面积图

enter image description here

现在我正在尝试将plotOption.area.pointStart更改为new Date(epoch*1000)格式,我当前的代码是:

Highcharts.chart('container', {
chart: {
type: 'area'
},
title: {
text: ''
},
xAxis: {
type: 'datetime',
tickInterval: 24 * 3600 * 1000
},
yAxis: {
title: {
text: ''
},
labels: {
formatter: function () {
return this.value / 1000 + 'k';
}
}
},
tooltip: {
pointFormat: '{series.name} had stockpiled <b>{point.y:,.0f}</b><br/>warheads in {point.x}'
},
plotOptions: {
area: {
pointStart: new Date(1562716800*1000),
pointInterval: 24 * 3600 * 1000,
marker: {
enabled: false,
symbol: 'circle',
radius: 2,
states: {
hover: {
enabled: true
}
}
}
}
},
series: [{
name: 'Incoming Chat',
showInLegend: false,
data: [245, 212, 0]
}]
});

我不知道,但图表只显示单个日期,例如:

enter image description here

最佳答案

pointStart实际上只接收一个epoch int,这里是想要的版本

Highcharts.chart('container', {
chart: {
type: 'area'
},
xAxis: {
type: 'datetime'
},

plotOptions: {
series: {
pointStart: 1562716800*1000,
pointInterval: 24 * 3600 * 1000 // one day
}
},

title: {
text: ''
},

series: [{
data: [5325,1631,23]
}]
});

关于javascript - 带有日期点Start的 Highcharts 区域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57000993/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com