score:1

Accepted answer

you can use minpadding and maxpadding properties, but their value is relative to the length of the axis.


you can also define pointrange as 2 and correct ticks by using tickpositions or tickpositioner:

plotoptions: {
    column: {
        stacking: 'normal',
        pointrange: 2,
        pointwidth: 20,
    }
},
xaxis: {
    maxpadding: 0,
    minpadding: 0,
    tickpositions: [0, 1, 2]
},

live demo: http://jsfiddle.net/blacklabel/2xdwuah9/


finally, you can reset default margins and specify min and max for the x-axis:

plotoptions: {
    column: {
        stacking: 'normal',
        pointrange: 0,
        pointwidth: 20,
    }
},
xaxis: {
    maxpadding: 0,
    minpadding: 0,
    min: -1,
    max: 3
},

live demo: http://jsfiddle.net/blacklabel/96pw12u0/


api reference:

https://api.highcharts.com/highcharts/xaxis.minpadding

https://api.highcharts.com/highcharts/series.column.pointrange

https://api.highcharts.com/highcharts/xaxis.tickpositioner

https://api.highcharts.com/highcharts/xaxis.min


Related Query

More Query from same tag