|
JsChartViewer question |
Posted by at on Jul-26-2012 17:19 |
|
Hi Peter,
I generated the chart after the window is loaded via ajax request, so the statement
JsChartViewer.addEventListener(window, 'load', function() {
....
....
}
didn't work. What can i do to make it work through ajax? I'm trying your new jsChartModel for the mouseover
of many hotspots of the chart. Thanks. |
Re: JsChartViewer question |
Posted by Peter Kwan on Jul-30-2012 21:55 |
|
Hi at,
In a typical web page, the HTML may load quite fast. After that, the browser will load the images one by one, As there can be a lot of images in a web page, and the images can be quite large in file size, this stage can be quite slow.
We use the window "load" event to initialize the track cursor, because we do not want the track cursor to start working after the HTML web page is loaded. Instead, we want the track cursor to start working after the chart image is loaded.
If the window load event is not applicable in your case, you may replace it with any event you like that have the same functions. In some cases, you may use the load event of the <IMG> tag itself to determine if the image has been loaded. It is like:
var f = function() { ...initialize track cursor... };
JsChartViewer.addEventListener(document.getElementById("<?php echo $viewer->getId()?>"), 'load', f);
Hope this can help.
Regards
Peter Kwan |
|