Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

remove print button

I'm creating charts with the HighCharts library and I wonder how to remove the 2 little buttons on the right corner which one you can print and download graphs and I'd like to add a new one.

Maybe someone could help me?

like image 509
Sam Shawn Avatar asked Dec 28 '22 00:12

Sam Shawn


2 Answers

You can disable the buttons if you like, according to the documentation. The documentation even provides an example of the chart being loaded, with the buttons disabled.

In your configuration, be sure to include the following:

var chart = new Highcharts.Chart({
    /* Other items removed to focus on navigation */
    navigation: {
        buttonOptions: {
            enabled: false
        }
    }
});
like image 75
Sampson Avatar answered Jan 14 '23 07:01

Sampson


If you want to remove all buttons the best place to do it is here:

exporting: {
    enabled: false
}

If you disable on the navigation only buttons are disabled, the exporting module continue to be loaded.
To disable only one button you have to use the following:

exporting: {
    buttons: {
        exportButton: {
            enabled: false
        }
    }
}

The code below disable the export button.

I don't know how to add a button without adding a new svg element, but if you won't to use export buttons, why don't you change your chart button style and function ? You can do it following the reference.

like image 29
Ricardo Alvaro Lohmann Avatar answered Jan 14 '23 07:01

Ricardo Alvaro Lohmann