I am using Oracle Apex to build a web application now, and I want to use Javascript to add a style class to a chart series after click one button. According to Add filters to Interactive Grid via Javascript, I knew that the region can be find via static id
and manipulated. Therefore, I give a static ID to the chart series, and I wonder how can I locate the chart series, and add a style css to the chart using Javascript in Dynamic Action.
Update:
Based on the Sample Charts (Area) example, I created a button called change color
, and define a dynamic action which will be triggered when the button is clicked. The true action is to execute the Javascript code, which is listed as below:
$(function( options ) {
// Setup a callback function which gets called when data is retrieved, to manipulate the series data
options.dataFilter = function( data ) {
data.series[ 0 ].color = "#90ee90";
return data;
};
return options;
});
After the execution of the Javascript, the data.series[0]
should be changed to green color. However, nothing happened after the execution.