Search code examples
highchartstreemap

Change the text of the back button on Highcharts Treemap?


I would like to change the text of the back / drill up button of my Highcharts Treemap. The button appears after the users click on the map to drill one level down.

By default, it shows "◁ Back" and I want to change it.

I have tried many different ways as shown below:

chart: {
  drilldown: {
    drillUpButton: {
      text: 'asdsad'
    }
  }
},

  Highcharts.setOptions({
lang: {
  thousandsSep: ',',
  drillUpText: 'asdasd',
  accessibility: {
    drillUpButton: 'terst'
  }
}})

Unfortunately, none of them works.

Appreciate your help.


Solution

  • The treemap series doesn't use the drilldown module, it has implemented its own logic for drilldown and the drillup button text could be defined in the series config.

    series: [{
      type: 'treemap',
      layoutAlgorithm: 'squarified',
      allowDrillToNode: true,
      drillUpButton: {
        text: '<< test button'
      },
      data: points
    }],
    

    Demo: https://jsfiddle.net/BlackLabel/nyjtufL7/