4

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

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

4

1 回答 1

3

您可以设置 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

于 2013-03-08T10:47:41.690 回答