Markcce Eros Markcce Eros - 20 days ago 15
Javascript Question

Highcharts exporting.js change menu hover title text

I am using highcharts and I've added exporting.js so I can export data.

This makes a menu appear which has a title of "Chart context menu".

See image attached:

enter image description here

You can also see it here:

$(function () {
Highcharts.chart('container', {

chart: {
type: 'column'
},

title: {
text: 'Total fruit consumtion, grouped by gender'
},

xAxis: {
categories: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas']
},

yAxis: {
allowDecimals: false,
min: 0,
title: {
text: 'Number of fruits'
}
},

tooltip: {
formatter: function () {
return '<b>' + this.x + '</b><br/>' +
this.series.name + ': ' + this.y + '<br/>' +
'Total: ' + this.point.stackTotal;
}
},

plotOptions: {
column: {
stacking: 'normal'
}
},

series: [{
name: 'John',
data: [5, 3, 4, 7, 2],
stack: 'male'
}, {
name: 'Joe',
data: [3, 4, 4, 2, 5],
stack: 'male'
}, {
name: 'Jane',
data: [2, 5, 6, 2, 1],
stack: 'female'
}, {
name: 'Janet',
data: [3, 0, 4, 4, 3],
stack: 'female'
}]
});
});


My question is..How can I change the title text so it says something else?

Answer

Actually, there is an option to change the title via API but you need to set it in the global options - lang.contextMenuTitle

Highcharts.setOptions({
  lang: {
    contextButtonTitle: 'custom text'
  }
});

example: http://jsfiddle.net/1zmwjskz/

Comments