ChartDirector 6.0 (Perl Edition)

JsChartViewer.ViewPortChanged


Description

This event occurs when the viewport is changed through mouse actions (see JsChartViewer.setMouseUsage).

Use JsChartViewer.attachHandler with the event id "ViewPortChanged" to attach a handler to this event.

If the browser supports partial chart update (that is, AJAX request - see JsChartViewer.canSupportPartialUpdate), the JsChartViewer.partialUpdate method can be attached to this event, so a partial chart update will occur when the viewport changes. If the browser does not support partial chart update, a function to perform a full page update may be attached to this event.

For example, the following is some typical code used after the web page is loaded (typically in the onLoad event handler of the <BODY> tag).

// Detect if browser is capable of support partial update (AJAX chart update)
if (JsChartViewer.canSupportPartialUpdate())
    // Can support partial update, use partialUpdate when viewport changed
    viewer.attachHandler("ViewPortChanged", viewer.partialUpdate);
else
    // Cannot support support partial update, so use full page update (in this
    // example, we assume this can be by submitting a form in the web page)
    viewer.attachHandler("ViewPortChanged", function() { document.forms[0].submit(); });