score:1

You can achieve this using drilldown/up events, and a custom name per series, like this:

The drillevents:

chart: {
  events: {
    drilldown: function(e) { 
      this.xAxis[0].setTitle({text: e.seriesOptions.customName})
    }, drillup: function(e) { 
      this.xAxis[0].setTitle({text: e.seriesOptions.customName})
    }, drillupall: function() {
      this.xAxis[0].setTitle({text: 'TextTopLevel'})
    }
  }
},

The series:

{
  id: 'fruits',
  customName: 'Custom title goes here',
  data: [
    ['Apples', 4],
    ['Oranges', 2]
  ]
}

// Create the chart
Highcharts.chart('container', {
    chart: {
        type: 'column',
        events: {
        drilldown: function(e) { 
          this.xAxis[0].setTitle({text: e.seriesOptions.customName})
        }, drillup: function(e) { 
          this.xAxis[0].setTitle({text: e.seriesOptions.customName})
        }, drillupall: function() {
          this.xAxis[0].setTitle({text: 'TextTopLevel'})
        }
      }
    },
    title: {
        text: 'Basic drilldown'
    },
    xAxis: {
        type: 'category',
        title: {
        	text: 'Categories'
        }
    },

    legend: {
        enabled: false
    },

    plotOptions: {
        series: {
            borderWidth: 0,
            dataLabels: {
                enabled: true
            }
        }
    },

    series: [{
        name: 'Things',
        colorByPoint: true,
        data: [{
            name: 'Animals',
            y: 5,
            drilldown: 'animals'
        }, {
            name: 'Fruits',
            y: 2,
            drilldown: 'fruits'
        }, {
            name: 'Cars',
            y: 4,
            drilldown: 'cars'
        }]
    }],
    drilldown: {
        series: [{
            id: 'animals',
            customName: 'test1',
            data: [
                ['Cats', 4],
                ['Dogs', 2],
                ['Cows', 1],
                ['Sheep', 2],
                ['Pigs', 1]
            ]
        }, {
            id: 'fruits',
            customName: 'test2',
            data: [
                ['Apples', 4],
                ['Oranges', 2]
            ]
        }, {
            id: 'cars',
            customName: 'test3',
            data: [
                ['Toyota', 4],
                ['Opel', 2],
                ['Volkswagen', 2]
            ]
        }]
    }
});
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/drilldown.js"></script>

<div id="container" style="min-width: 310px; height: 200px; margin: 0 auto"></div>

JSFiddle working example: http://jsfiddle.net/ewolden/p8vfy27h/


Related Query

More Query from same tag