gpt4 book ai didi

highcharts - Highchart Stacked Column with/Datetime X-axis Columns太薄

转载 作者:行者123 更新时间:2023-12-03 11:19:09 25 4
gpt4 key购买 nike

我试图向我的用户显示他们的每台摄像机每天录制的视频数量。为此,我想使用堆叠的背面(每个堆叠显示使用给定相机录制的视频数量)。以下是我传入的选项:

var options = { 
"title": {
"text": null
},
"legend": {
"layout": "vertical",
"style": { },
"enabled": false
},
"xAxis": {
"type": "datetime",
"minTickInterval": 86400000
},
"yAxis": {
"stackLabels": { "enabled": true },
"title": { "text": null }
},
"tooltip": { "enabled": true },
"credits": { "enabled": false },
"plotOptions": {
"column": { "stacking": "normal" }
},
"chart": {
"defaultSeriesType": "column",
"height": 200,
"borderRadius": 0,
"renderTo": "monthy_chart"
},
"subtitle": { },
"colors": [ "#c7084b","#089fbf","#00d047","#d300d1","#f48400","#f6f400" ],
"series": [
{
"name": "Camera",
"data": [ [ 1362614400000,6 ],[ 1362528000000,2 ] ]
},
{
"name": "NewCamera2",
"data": [ [ 1362614400000,1 ] ]
}
]
};

该图表正确显示了数据,但即使只有 2 天的数据(下图),也会将列呈现得非常窄。有没有办法让我定义 x 轴的比例,这样列的宽度会显示得更好一点?

http://i.stack.imgur.com/NSSYg.png

最佳答案

您可以设置 pointWidth 和 startOnTick/endOfTick

http://jsfiddle.net/bLrah/

 "xAxis": {
startOnTick:true,
endOnTick:true,
"type": "datetime",
"minTickInterval": 86400000

http://api.highcharts.com/highcharts#xAxis.startOnTick
http://api.highcharts.com/highcharts#xAxis.endOnTick
http://api.highcharts.com/highcharts#plotOptions.column.pointWidth

关于highcharts - Highchart Stacked Column with/Datetime X-axis Columns太薄,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15281134/

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