APEX 21.2. Jet Chart. Would like to set the stack and type properties of the options chart object dynamically and refresh the chart region - no page submit.
However the chart's initialisation code only runs at page load. And a APEX region refresh() only refreshes the chart object's options.data.series[*] members - not the chart's options object.
Sample Javascript Initialisation Code of chart:
function( options ){
options.dataFilter = function( data ) {
data.series[0].color = "#4cd964";
data.series[1].color = "#ff3b30";
return data;
};
options.stack = $v("P1_STACK");
if (options.stack == "on"){
options.type = "lineWithArea";
} else{
options.type = "line";
};
if ($v("P1_BAR") == "on"){
options.type = "bar";
};
return options;
}
On chart region refresh (triggered by changing either P1_STACK or P1_BAR switches), the console reports (via APEX runtime messages) the refresh of series[0] and series[1] only.
Thus instead of an "on Change" event , then set options.type and options.stack and refresh the chart's region, an APEX “page submit” event needs to be used in order to refresh the chart with the changed options.
Suggestions, work-arounds, and comments will be welcomed.