score:0

as of 5 years later, do this:

legend: {
    enabled: true,
    labelformatter: function() {
    let legendname = this.series.chart.axes[0].categories[this.x];
    return legendname;}}

score:5

you can do this with tooltip.formatter and legend.labelformatter and accessing the highchart options.

for the tooltip text:

tooltip: {
  formatter: function() {
    var sliceindex = this.point.index;
    var slicename = this.series.chart.axes[0].categories[sliceindex];
    return 'the value for <b>' + slicename +
      '</b> is <b>' + this.y + '</b>';
  }
},

and for the legend:

legend: {
  enabled: true,
  labelformatter: function() {
    var legendindex = this.index;
    var legendname = this.series.chart.axes[0].categories[legendindex];

    return legendname;
  }
},

live demo.


Related Query

More Query from same tag