Skip to content

Commit 080a0b0

Browse files
Add disable legend option in chartjs chart #965
1 parent 0585651 commit 080a0b0

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)