Sadikhasan
Sadikhasan

Reputation: 18600

How to delete graph on click

Here highchart custom button code I want to close graph on click of custom button.

    exporting: {
        buttons: {
            customButton: {
                x: -62,
                onclick: function () {
                    alert("I want to delete graph here");
                },
                symbol: 'circle'
            }
        }
    }

JS Fiddle

Upvotes: 0

Views: 515

Answers (1)

Michael Lumbroso
Michael Lumbroso

Reputation: 4993

In the documentation, there is the method destroy() with a jsfiddle example : http://api.highcharts.com/highcharts#Chart.destroy

working JSFiddle

exporting: {
        buttons: {
            customButton: {
                x: -62,
                onclick: function () {
                    chart.destroy();
                },
                symbol: 'circle'
            }
        }
    }

Upvotes: 1

Related Questions