mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 04:37:48 +02: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
|
// start shifting the chart once we hit 20 data points
|
||||||
var shift = currentHighchart.series[0].data.length > 20;
|
var shift = currentHighchart.series[0].data.length > 20;
|
||||||
currentHighchart.series[0].addPoint([x, y], true, shift);
|
currentHighchart.series[0].addPoint([x, y], true, shift);
|
||||||
}
|
}
|
||||||
}).fail(function(data) {
|
}).fail(function(data) {
|
||||||
$('#stats-container th').each(function(){
|
$('#stats-container th').each(function(){
|
||||||
$(this).addClass('stale');
|
$(this).addClass('stale');
|
||||||
|
@ -56,13 +56,18 @@ $(document).ready(function(){
|
||||||
|
|
||||||
// add a function to help create the graph modal
|
// add a function to help create the graph modal
|
||||||
function createGraphModal() {
|
function createGraphModal() {
|
||||||
bootbox.dialog({
|
var chartModal = bootbox.dialog({
|
||||||
title: graphKeypath,
|
title: graphKeypath,
|
||||||
message: "<div id='highchart-container'></div>",
|
message: "<div id='highchart-container'></div>",
|
||||||
buttons: {},
|
buttons: {},
|
||||||
className: 'highchart-modal'
|
className: 'highchart-modal'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
chartModal.on('hidden.bs.modal', function(e) {
|
||||||
|
currentHighchart.destroy();
|
||||||
|
currentHighchart = null;
|
||||||
|
});
|
||||||
|
|
||||||
currentHighchart = new Highcharts.Chart({
|
currentHighchart = new Highcharts.Chart({
|
||||||
chart: {
|
chart: {
|
||||||
renderTo: 'highchart-container',
|
renderTo: 'highchart-container',
|
||||||
|
|
Loading…
Reference in a new issue