That's an interesting idea. I have a workaround (below), but I'll probably
try that the next time I do something like this.
I ended up redrawing each sparkline separately in its own setTimeout
function that fires at some random interval (interval length depends on how
many charts I have, so I aim for 100 charts in 1 second).
This prevents the browser from hanging when I redraw all the sparklines at
once (or even very close together in time). It's also somewhat pleasing to
see the sparklines appear after the sort. And it's fast enough to still be
functional.
Thanks for the advice, though, really appreciate it.
Code snippet below:
google.visualization.events.addListener(tableWrap.getChart(),'sort',UpdateSparklines);
function UpdateSparklines() {
var sparkCharts = jQuery('.hitsChart');
var listLength = myList.length
jQuery.each(sparkCharts,
function(idx,item){
setTimeout(function(){
jQuery(item).sparkline('html', {enableTagOptions:
true, type:'bar', barColor:'#2562ae',height:15});
},Math.random()*10*listLength);
}
);
*
*
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-visualization-api/-/1KA1IN8zAC0J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en.