← All changes
|
classes/Visualizer/Gutenberg/src/Components/Sidebar/VerticalAxisSettings.js
+11
-25
3.10.11
→
3.4.2
View file →
| @@ -17,10 +17,8 @@ | ||
| 17 | 17 | SelectControl, |
| 18 | 18 | TextControl |
| 19 | 19 | } = wp.components; |
| 20 | 20 | |
| 21 | -import { getColorCode } from '../../utils.js'; | |
| 22 | - | |
| 23 | 21 | class VerticalAxisSettings extends Component { |
| 24 | 22 | constructor() { |
| 25 | 23 | super( ...arguments ); |
| 26 | 24 | } |
| @@ -86,11 +84,11 @@ | ||
| 86 | 84 | <BaseControl |
| 87 | 85 | label={ __( 'Base Line Color' ) } |
| 88 | 86 | > |
| 89 | 87 | <ColorPalette |
| 90 | - value={ settings.hAxis.baselineColor } | |
| 88 | + value={ settings.vAxis.baselineColor } | |
| 91 | 89 | onChange={ e => { |
| 92 | - settings.hAxis.baselineColor = getColorCode( e ); | |
| 90 | + settings.vAxis.baselineColor = e; | |
| 93 | 91 | this.props.edit( settings ); |
| 94 | 92 | } } |
| 95 | 93 | /> |
| 96 | 94 | </BaseControl> |
| @@ -101,15 +99,15 @@ | ||
| 101 | 99 | <ColorPalette |
| 102 | 100 | value={ settings.vAxis.textStyle.color || settings.vAxis.textStyle } |
| 103 | 101 | onChange={ e => { |
| 104 | 102 | settings.vAxis.textStyle = {}; |
| 105 | - settings.vAxis.textStyle.color = getColorCode( e ); | |
| 103 | + settings.vAxis.textStyle.color = e; | |
| 106 | 104 | this.props.edit( settings ); |
| 107 | 105 | } } |
| 108 | 106 | /> |
| 109 | 107 | </BaseControl> |
| 110 | 108 | |
| 111 | - { ( -1 >= [ 'bar' ].indexOf( type ) ) && ( | |
| 109 | + { ( -1 >= [ 'column' ].indexOf( type ) ) && ( | |
| 112 | 110 | <Fragment> |
| 113 | 111 | |
| 114 | 112 | <TextControl |
| 115 | 113 | label={ __( 'Number Format' ) } |
| @@ -130,9 +128,9 @@ | ||
| 130 | 128 | </p> |
| 131 | 129 | |
| 132 | 130 | <p> |
| 133 | 131 | { __( 'For date axis labels, this is a subset of the date formatting ' ) } |
| 134 | - <ExternalLink href="https://unicode-org.github.io/icu/userguide/format_parse/datetime/#datetime-format-syntax"> | |
| 132 | + <ExternalLink href="http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"> | |
| 135 | 133 | { __( 'ICU date and time format.' ) } |
| 136 | 134 | </ExternalLink> |
| 137 | 135 | </p> |
| 138 | 136 | |
| @@ -152,9 +150,9 @@ | ||
| 152 | 150 | > |
| 153 | 151 | |
| 154 | 152 | <TextControl |
| 155 | 153 | label={ __( 'Count' ) } |
| 156 | - help={ __( 'The approximate number of vertical gridlines inside the chart area. You can specify a value of -1 to automatically compute the number of gridlines, 0 or 1 to draw no gridlines, or 2 or more to only draw gridline. Any number greater than 2 will be used to compute the minSpacing between gridlines.' ) } | |
| 154 | + help={ __( 'The number of Vertical gridlines inside the chart area. Minimum value is 2. Specify -1 to automatically compute the number of gridlines.' ) } | |
| 157 | 155 | value={ settings.vAxis.gridlines ? settings.vAxis.gridlines.count : '' } |
| 158 | 156 | onChange={ e => { |
| 159 | 157 | if ( ! settings.vAxis.gridlines ) { |
| 160 | 158 | settings.vAxis.gridlines = {}; |
| @@ -190,14 +188,11 @@ | ||
| 190 | 188 | > |
| 191 | 189 | |
| 192 | 190 | <TextControl |
| 193 | 191 | label={ __( 'Count' ) } |
| 194 | - help={ __( 'Specify 0 to disable the minor gridlines.' ) } | |
| 195 | - value={ settings.vAxis.minorGridlines ? settings.vAxis.minorGridlines.count : '' } | |
| 192 | + help={ __( 'The number of Vertical minor gridlines between two regular gridlines.' ) } | |
| 193 | + value={ settings.vAxis.minorGridlines.count } | |
| 196 | 194 | onChange={ e => { |
| 197 | - if ( ! settings.vAxis.minorGridlines ) { | |
| 198 | - settings.vAxis.minorGridlines = {}; | |
| 199 | - } | |
| 200 | 195 | settings.vAxis.minorGridlines.count = e; |
| 201 | 196 | this.props.edit( settings ); |
| 202 | 197 | } } |
| 203 | 198 | /> |
| @@ -205,13 +200,10 @@ | ||
| 205 | 200 | <BaseControl |
| 206 | 201 | label={ __( 'Color' ) } |
| 207 | 202 | > |
| 208 | 203 | <ColorPalette |
| 209 | - value={ settings.vAxis.minorGridlines ? settings.vAxis.minorGridlines.color : '' } | |
| 204 | + value={ settings.vAxis.minorGridlines.color } | |
| 210 | 205 | onChange={ e => { |
| 211 | - if ( ! settings.vAxis.minorGridlines ) { | |
| 212 | - settings.vAxis.minorGridlines = {}; | |
| 213 | - } | |
| 214 | 206 | settings.vAxis.minorGridlines.color = e; |
| 215 | 207 | this.props.edit( settings ); |
| 216 | 208 | } } |
| 217 | 209 | /> |
| @@ -227,13 +219,10 @@ | ||
| 227 | 219 | |
| 228 | 220 | <TextControl |
| 229 | 221 | label={ __( 'Maximun Value' ) } |
| 230 | 222 | help={ __( 'The maximum vertical data value to render.' ) } |
| 231 | - value={ settings.vAxis.viewWindow ? settings.vAxis.viewWindow.max : '' } | |
| 223 | + value={ settings.vAxis.viewWindow.max } | |
| 232 | 224 | onChange={ e => { |
| 233 | - if ( ! settings.vAxis.viewWindow ) { | |
| 234 | - settings.vAxis.viewWindow = {}; | |
| 235 | - } | |
| 236 | 225 | settings.vAxis.viewWindow.max = e; |
| 237 | 226 | this.props.edit( settings ); |
| 238 | 227 | } } |
| 239 | 228 | /> |
| @@ -240,13 +229,10 @@ | ||
| 240 | 229 | |
| 241 | 230 | <TextControl |
| 242 | 231 | label={ __( 'Minimum Value' ) } |
| 243 | 232 | help={ __( 'The minimum vertical data value to render.' ) } |
| 244 | - value={ settings.vAxis.viewWindow ? settings.vAxis.viewWindow.min : '' } | |
| 233 | + value={ settings.vAxis.viewWindow.min } | |
| 245 | 234 | onChange={ e => { |
| 246 | - if ( ! settings.vAxis.viewWindow ) { | |
| 247 | - settings.vAxis.viewWindow = {}; | |
| 248 | - } | |
| 249 | 235 | settings.vAxis.viewWindow.min = e; |
| 250 | 236 | this.props.edit( settings ); |
| 251 | 237 | } } |
| 252 | 238 | /> |