Created
February 21, 2016 17:07
-
-
Save danpette/aec02c1a7a7fbaaf299b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//graph1, graph2 are Chart instance | |
//modal is a global modal = $(this); from within $('.yourdiv').on('shown', function(event){ .... | |
//generateChart is method setting graph1 to new Chart. | |
//if dynamic/many charts make this dynamic, in this example i will always try to load both tabs, logic for only generating current should be implementet :) | |
$('#statistics-tabs a').click(function (e) { | |
e.preventDefault(); | |
$(this).tab('show'); | |
setTimeout(function(){ | |
if(graph1 != undefined) graph1.destroy(); | |
if(graph2 != undefined) graph2.destroy(); | |
$('#graph1').attr('height',300).attr('width',868); | |
$('#graph2').attr('height',300).attr('width',868); | |
generateChart(modal, '1'); | |
generateChart(modal, '2'); | |
}, 500); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment