Skip to content

Commit fa10d4b

Browse files
Merge pull request #966 from Codeinwp/bugfix/965
Added disable legend option for chartjs chart
2 parents 5d5c8fc + 080a0b0 commit fa10d4b

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

classes/Visualizer/Render/Sidebar/ChartJS.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ public function __construct( $data = array() ) {
3535
'right' => esc_html__( 'Right of the chart', 'visualizer' ),
3636
'top' => esc_html__( 'Above the chart', 'visualizer' ),
3737
'bottom' => esc_html__( 'Below the chart', 'visualizer' ),
38+
'bottom' => esc_html__( 'Below the chart', 'visualizer' ),
39+
'none' => esc_html__( 'Omit the legend', 'visualizer' ),
3840
);
3941

4042
}

js/render-chartjs.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@
197197
}
198198
}
199199

200+
settings.plugins = {
201+
legend: settings.legend,
202+
};
203+
200204
handleAxes(settings, chart);
201205

202206
override(settings, chart);

0 commit comments

Comments
 (0)