4
votes

In this HighCharts example, how do I remove the gap between where the xaxis starts and where the tick for Jan is.

http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/xaxis/tickmarkplacement-on/

basically I want to put Jan right where the xAxis starts. I couldn't find how to do it in the API.

1

1 Answers

6
votes

There seems to be a problem with categories and startOnTick. But you can imitate categories and make it work:

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

        labels: {
            enabled: true,
            formatter: function () {
                return categories[this.value];
            }
        },
        tickInterval: 1,
        minPadding: 0,
        maxPadding: 0,
        startOnTick: true,
        endOnTick: true
    },

    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]
    }]
});

http://jsfiddle.net/zdMTy/