Filter
rpress_category_sales_graph_options
On this page
Filters the options passed to the category sales pie chart.
Runs just after rpress_category_sales_graph_data and before the RPRESS_Pie_Graph is created. The default array only sets legend_formatter; any other pie graph option such as height, legend_columns or legend_position can be added and is merged over the graph defaults.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$options | array | Pie graph options. By default only legend_formatter is set. |
$data | array | The label => total sales array that will be plotted. |
Return value#
array. The pie graph options.
Example#
function my_sales_pie_options( $options, $data ) {
$options['height'] = 400;
$options['legend_columns'] = 2;
return $options;
}
add_filter( 'rpress_category_sales_graph_options', 'my_sales_pie_options', 10, 2 );
Notes#
Fired from both the categories report table and the add-ons report table.
Source#
Applied in:
includes/admin/reporting/class-addons-reports-table.php(line 279), inRPRESS_Addons_Reports_Table::output_sales_graph()includes/admin/reporting/class-categories-reports-table.php(line 279), inRPRESS_Categories_Reports_Table::output_sales_graph()
See also#
Was this page helpful?
