wpdatatables_filter_chartjs_render_data

Contents

Description

This filter is used to modify the chart options before it is passed to the Chart.js renderer.

Usage

add_filter( 'wpdatatables_filter_chartjs_render_data', 'modify_chartjs_render_data', 10, 3 );

Parameters

  • $renderData array
    The array containing chart configuration data that will be used to render the chart.
  • $chartId string
    The ID of the chart.
  • $chartObject object
    The instance of the chart class.

Examples

// Callback function for the wpdatatables_filter_chartjs_render_data filter hook
function modify_chartjs_render_data($renderData, $chartId, $chartObject) {
    // Your code
    return $renderData;
}

add_filter( 'wpdatatables_filter_chartjs_render_data', 'modify_chartjs_render_data', 10, 3 );