Changing properties in preExecution or postFetch

We are able to change the properties for the charts, as with any other component. Inside preExecution, the keyword this, refers to the component itself, so we will have access to the chart's main object, which we can also manipulate and add, remove, and change options.

For instance, you can apply the following code:

function() {
   var cdProps = {
        dotsVisible: true,
        plotFrame_strokeStyle: '#bbbbbb',
        colors: ['#005CA7', '#FFC20F', '#333333', '#68AC2D']
    }; 
    $.extend(true, this.chartDefinition, cdProps);
}

What we are doing is creating an object with all the properties that we want to add or change for the chart, and then extending the chartDefinitions (where the properties or options are). This is what we ...

Get Learning Pentaho CTools now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.