什么时候完成高分图? [英] when is a highchart completely loaded?
问题描述
我看到以下代码: http://jsfiddle.net/AVygG/
我很好奇Highchart完全加载的时间点是什么时候?我在highcharts文档中看到, events:load:在完成加载高图时可以调用回调函数。
I'm curious when is the point that the highchart gets loaded completely? I saw in highcharts documentation that events: load: should do the magic of being able to call the callback function when the highchart is completely loaded.
如果它已完全加载,那么我可以假设当弹出警告时,var chart 应该已经有了值吗?这是一个很好的基础,该图表已经加载?
If it were completely loaded, then could I assume that var chart should already have the values when the alert pops? Is that a good basis that the chart is already loaded?
我问的原因是我正在处理另一个代码,该图表显然没有完全加载在IE8中。看起来highcharts在加载元素时可能存在争用条件。
The reason I asked is that I'm working on another code that the highchart apparently doesn't get loaded completely in IE8. Looks like highcharts is potentially having a race condition on the loading of its elements.
谢谢!
Thanks!
$(function () {
// create the chart
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
events: {
load: function(event) {
alert ('Chart loaded');
}
}
},
xAxis: {
},
series: [{
animation: false,
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}]
});
});
推荐答案
Highcharts具有回调函数
Highcharts has callback function
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
events: {
redraw: function(event) {
alert ('Chart loaded');
}
}
},
series: [{
animation: false,
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}]
},function(chart){
alert('LOADED');
});
这篇关于什么时候完成高分图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!