开发者

Highchart specific width stack column bar graph

Need to find a way to represent a graph with error bar, but it seems that it's not supporting in the highchart开发者_Go百科 at the moment. My plan is to use a stack column bar chart with 0 to lower Y as transparent, and lower Y to upper Y with a red color or whatever I am gonna pick later.

My question is:

Is it possible limit the stack column bar width to say 1px regardless the zoom level in highchart?

Thanks for the input!


Just figured out this myself. pointWidth is the parameter to set the width for bar width. Also the walk around is nice for represent the error bar since there aren't any highly interactive javascript chart support this type of chart yet.


series: [{
            name: strSeriesTitle,
            data: arrData,
            pointWidth: 28
        }]


A working DEMO for setting width of column bars irrespective of the chart size.

You will have to use pointWidth option like:

$(function () {
    $('#container').highcharts({
        chart: {
            type: 'column'
        },
        xAxis: {
            categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
        },

        plotOptions: {
            series: {
                pointWidth: 40//width of the column bars irrespective of the chart size
            }
        },

        series: [{
            data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
        }]
    });
});


You should use the following options instead of pointWidth to be responsive and not fixed:

plotOptions: {
    series: {
        pointPadding: 0, // Defaults to 0.1
        groupPadding: 0.01 // Defaults to 0.2
    }
},
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜