gpt4 book ai didi

javascript - 当最小值和最大值打开时,Highchart 日期时间图 x 轴无法获取绘图上的数据

转载 作者:行者123 更新时间:2023-11-28 20:26:54 26 4
gpt4 key购买 nike

$(function () {
$('#container').highcharts({
chart: {
showAxes : true,
type: 'line',
marginRight: 130,
marginBottom: 25
},
tooltip: {
crosshairs: [true],
shared : true
},
title: {
text: '',
x: -20 //center
},
subtitle: {
text: '',
x: -20
},
xAxis: {
type :'datetime',
tickInterval : 12*30*24*3600* 1000,
min : Date.UTC(2011, 0, 1),
max : Date.UTC(2020, 0, 1),
label : {
align : 'left'
}
},
yAxis: {
title: {
text: 'PRICE Rs. / SQ.FT.'
},
lineWidth: 2,
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},

series: [{
data:[2165,1831,2798,2200,2237,2799,2400,2500,2865,2850]
}]
});
});

我的 x 轴包含年份,数据系列包含我想在 Y 轴上显示的信息。当我删除从 2010 年到 2022 年的时间间隔时,我。 e comment min and max option highcharts 绘制从 1970 年开始的图表,但之后没有点。 http://jsfiddle.net/R8kx7/3/这是链接

最佳答案

根据您对 @SteveP 答案的评论,如果您不想将每个系列的 x 值与每个 y 显式配对,请使用 plotOptions.series pointStartpointInterval属性。

       plotOptions: {
series: {
pointStart: Date.UTC(2011, 0, 1),
pointInterval : 12*30*24*3600* 1000
}
},
series: [{
data:[2165,1831,2798,2200,2237,2799,2400,2500,2865,2850]
}]

更新了 fiddle here .

关于javascript - 当最小值和最大值打开时,Highchart 日期时间图 x 轴无法获取绘图上的数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17192933/

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