nullify the current Highchart when modal closed

This commit is contained in:
Stephen Birarda 2015-05-01 16:21:05 -07:00
parent 6d0e612923
commit 7b4522e950

View file

@ -56,13 +56,18 @@ $(document).ready(function(){
// add a function to help create the graph modal
function createGraphModal() {
bootbox.dialog({
var chartModal = bootbox.dialog({
title: graphKeypath,
message: "<div id='highchart-container'></div>",
buttons: {},
className: 'highchart-modal'
});
chartModal.on('hidden.bs.modal', function(e) {
currentHighchart.destroy();
currentHighchart = null;
});
currentHighchart = new Highcharts.Chart({
chart: {
renderTo: 'highchart-container',