@@ -34,6 +34,18 @@ class GeneralSettings extends Component {
34
34
35
35
tooltipTriggers [ 2 ] = { label : __ ( 'The tooltip will not be displayed' ) , value : 'none' } ;
36
36
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
+
37
49
return (
38
50
< PanelBody
39
51
title = { __ ( 'General Settings' ) }
@@ -178,14 +190,7 @@ class GeneralSettings extends Component {
178
190
label = { __ ( 'Position' ) }
179
191
help = { __ ( 'Determines where to place the legend, compared to the chart area.' ) }
180
192
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 }
189
194
onChange = { e => {
190
195
if ( 'pie' !== type ) {
191
196
let axis = 'left' === e ? 1 : 0 ;
0 commit comments