Skip to content

Commit 78f0986

Browse files
Merge pull request #726 from contactashish13/issue-718
Google Pie charts should not show Inside the Chart option for legend position
2 parents 9ed32ce + 6ff8e40 commit 78f0986

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

classes/Visualizer/Gutenberg/build/block.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

classes/Visualizer/Gutenberg/src/Components/Sidebar/GeneralSettings.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@ class GeneralSettings extends Component {
3434

3535
tooltipTriggers[2] = { label: __( 'The tooltip will not be displayed' ), value: 'none' };
3636

37+
let positions = [
38+
{ label: __( 'Left of the chart' ), value: 'left' },
39+
{ label: __( 'Right of the chart' ), value: 'right' },
40+
{ label: __( 'Above the chart' ), value: 'top' },
41+
{ label: __( 'Below the chart' ), value: 'bottom' },
42+
{ label: __( 'Omit the legend' ), value: 'none' }
43+
];
44+
45+
if ( 'pie' !== type ) {
46+
positions.push({ label: __( 'Inside the chart' ), value: 'in' });
47+
}
48+
3749
return (
3850
<PanelBody
3951
title={ __( 'General Settings' ) }
@@ -178,14 +190,7 @@ class GeneralSettings extends Component {
178190
label={ __( 'Position' ) }
179191
help={ __( 'Determines where to place the legend, compared to the chart area.' ) }
180192
value={ settings.legend.position ? settings.legend.position : 'right' }
181-
options={ [
182-
{ label: __( 'Left of the chart' ), value: 'left' },
183-
{ label: __( 'Right of the chart' ), value: 'right' },
184-
{ label: __( 'Above the chart' ), value: 'top' },
185-
{ label: __( 'Below the chart' ), value: 'bottom' },
186-
{ label: __( 'Inside the chart' ), value: 'in' },
187-
{ label: __( 'Omit the legend' ), value: 'none' }
188-
] }
193+
options={ positions }
189194
onChange={ e => {
190195
if ( 'pie' !== type ) {
191196
let axis = 'left' === e ? 1 : 0;

0 commit comments

Comments
 (0)