I want to have a 100% customizable chart on my Apex application. For this purpose I want to add an Anychart with Java Script and use custom xml.
I added the OracleAnyChart.swf and Preloader.swf files to Shared Components -> Static Application Files.
I have this code under "Execute when Page Loads"
AnyChart.renderingType = anychart.RenderingType.SVG_PREFERRED;
var chart = new AnyChart('#APP_IMAGES#OracleAnyChart.swf','#APP_IMAGES#Preloader.swf', 'be_chart');
chart.width = 600;
chart.height = 150;
chart.messages = {
loadingConfig: "Loading config...",
waitingForData: "Waiting for data..."}
console.log('ID = ' || chart.id);
var jqxhr = apex.server.process( 'GET_BEXML',
{
pageItems: "#BE_DATA"
},
{
dataType : 'text'
}
);
jqxhr.done(function(pData) {
console.log(chart.id);
chart.setData($v('BE_DATA'));
chart.write('container_be');
//chart.refresh();
}
);
My On demand process "GET_BEXML" sets the item BE_DATA with correct XML, but the chart does not render.
I tried to call
var chart = getChartById('be_chart');
chart.setData($v('BE_DATA'));
chart.refresh();
from a Dynamic action but it appears that I cant call any anychart functions in the Dynamic actions' scope, it says "getCharById its not defined".
Am I missing something?