2
votes

I'm trying to create a distance between the x-axis labels and the chart in Highcharts. I tried using "distance" and "padding" but none worked.

    chart: {
        type: 'column'
    },

    title: {
        text: 'Data input as column arrays'
    },

    data: {
        columns: [
            [null, 'Apples', 'Pears', 'Oranges'], // categories
            ['Blue', 1, 4, 3], // first series
            ['Black', 5, 4, 2] // second series
        ]
    },
    xAxis: {
  categories: [
    'First Category',
    'Second Category',
    'Third Category',
  ],
  labels: {
    style: {
    fontFamily: 'openSans',
    fontSize: '16px',
    color: '#000000',
    },
  }
}

Here is jsfiddle: http://jsfiddle.net/aaq4zww5/2/

Thanks!

1

1 Answers

5
votes

Option1: use the offset in the xAxis:

     xAxis: {
...
            offset: 10,
    },

Option2: use y under xAxis->labels:

      labels: {
...
          y: 25,
      },

Check jsfiddle.