score:21

Accepted answer

If you want to add custom tooltip text for a button, you must add a 'lang' object in the chart's options, and define a key with some text.

Then use that key in the custom button's definition.

var chart = new Highcharts.Chart({
    chart: {
        // your chart options
    },
    lang: {
       yourKey: "Custom button tooltip text"
    },
    exporting: {
        buttons: {
            yourCustomButton: {
                text: "Click me",
                _titleKey: "yourKey",
                onclick: function() {
                    // button functionality goes here
                }
            }
        }
    }
});

See http://jsfiddle.net/7wEEj/

score:0

I'd like to add that the lang option works even if the button is not custom. For instance,

lang: {
    myKey: "Hello"
},
exporting: {
    buttons: {
        exportButton: {
            _titleKey:"myKey",
            enabled: true
        },
        printButton: {
            enabled: true
                }
           }
    }, ...

gives you the possibility to translate the tooltips of the export and print button.

score:2

Add directly _titleKey, see: http://jsfiddle.net/x36qR/1/


Related Query

More Query from same tag