mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
nullify the current Highchart when modal closed
This commit is contained in:
parent
6d0e612923
commit
7b4522e950
1 changed files with 7 additions and 2 deletions
|
@ -32,7 +32,7 @@ $(document).ready(function(){
|
|||
// start shifting the chart once we hit 20 data points
|
||||
var shift = currentHighchart.series[0].data.length > 20;
|
||||
currentHighchart.series[0].addPoint([x, y], true, shift);
|
||||
}
|
||||
}
|
||||
}).fail(function(data) {
|
||||
$('#stats-container th').each(function(){
|
||||
$(this).addClass('stale');
|
||||
|
@ -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',
|
||||
|
|
Loading…
Reference in a new issue