| @@ -121,8 +121,18 @@ | ||
| 121 | 121 | $this->axisTitlesPosition, |
| 122 | 122 | $this->_positions, |
| 123 | 123 | esc_html__( 'Determines where to place the axis titles, compared to the chart area.', 'visualizer' ) |
| 124 | 124 | ); |
| 125 | + | |
| 126 | + echo '<div class="viz-section-delimiter"></div>'; | |
| 127 | + | |
| 128 | + self::_renderTextAreaItem( | |
| 129 | + esc_html__( 'Chart Description', 'visualizer' ), | |
| 130 | + 'description', | |
| 131 | + $this->description, | |
| 132 | + sprintf( esc_html__( 'Description to display in the structured data schema as explained %1$shere%2$s', 'visualizer' ), '<a href="https://developers.google.com/search/docs/data-types/dataset#dataset" target="_blank">', '</a>' ) | |
| 133 | + ); | |
| 134 | + | |
| 125 | 135 | } |
| 126 | 136 | |
| 127 | 137 | /** |
| 128 | 138 | * Renders general settings block for horizontal axis settings. |
| @@ -185,10 +195,12 @@ | ||
| 185 | 195 | self::_renderTextItem( |
| 186 | 196 | esc_html__( 'Count', 'visualizer' ), |
| 187 | 197 | 'hAxis[gridlines][count]', |
| 188 | 198 | isset( $this->hAxis['gridlines']['count'] ) ? $this->hAxis['gridlines']['count'] : '', |
| 189 | - esc_html__( 'The number of vertical gridlines inside the chart area. Minimum value is 2. Specify -1 to automatically compute the number of gridlines.', 'visualizer' ), | |
| 190 | - 5 | |
| 199 | + esc_html__( 'The approximate number of horizontal 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.', 'visualizer' ), | |
| 200 | + 5, | |
| 201 | + 'number', | |
| 202 | + array( 'min' => -1, 'max' => 1000, 'step' => 1 ) | |
| 191 | 203 | ); |
| 192 | 204 | |
| 193 | 205 | self::_renderColorPickerItem( |
| 194 | 206 | esc_html__( 'Color', 'visualizer' ), |
| @@ -202,10 +214,12 @@ | ||
| 202 | 214 | self::_renderTextItem( |
| 203 | 215 | esc_html__( 'Count', 'visualizer' ), |
| 204 | 216 | 'vAxis[minorGridlines][count]', |
| 205 | 217 | isset( $this->vAxis['minorGridlines']['count'] ) ? $this->vAxis['minorGridlines']['count'] : '', |
| 206 | - esc_html__( 'The number of horizontal minor gridlines between two regular gridlines.', 'visualizer' ), | |
| 207 | - 0 | |
| 218 | + esc_html__( 'Specify 0 to disable the minor gridlines.', 'visualizer' ), | |
| 219 | + 0, | |
| 220 | + 'number', | |
| 221 | + array( 'min' => 0, 'max' => 1, 'step' => 1 ) | |
| 208 | 222 | ); |
| 209 | 223 | |
| 210 | 224 | self::_renderColorPickerItem( |
| 211 | 225 | esc_html__( 'Color', 'visualizer' ), |
| @@ -215,9 +229,9 @@ | ||
| 215 | 229 | ); |
| 216 | 230 | self::_renderSectionEnd(); |
| 217 | 231 | } |
| 218 | 232 | |
| 219 | - if ( $this->_verticalGridLines ) { | |
| 233 | + if ( $this->_horizontalGridLines ) { | |
| 220 | 234 | self::_renderSectionStart( esc_html__( 'View Window', 'visualizer' ), false ); |
| 221 | 235 | self::_renderTextItem( |
| 222 | 236 | esc_html__( 'Maximum Value', 'visualizer' ), |
| 223 | 237 | 'hAxis[viewWindow][max]', |
| @@ -297,10 +311,12 @@ | ||
| 297 | 311 | self::_renderTextItem( |
| 298 | 312 | esc_html__( 'Count', 'visualizer' ), |
| 299 | 313 | 'vAxis[gridlines][count]', |
| 300 | 314 | isset( $this->vAxis['gridlines']['count'] ) ? $this->vAxis['gridlines']['count'] : '', |
| 301 | - esc_html__( 'The number of horizontal gridlines inside the chart area. Minimum value is 2. Specify -1 to automatically compute the number of gridlines.', 'visualizer' ), | |
| 302 | - 5 | |
| 315 | + esc_html__( '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.', 'visualizer' ), | |
| 316 | + 5, | |
| 317 | + 'number', | |
| 318 | + array( 'min' => -1, 'max' => 1000, 'step' => 1 ) | |
| 303 | 319 | ); |
| 304 | 320 | |
| 305 | 321 | self::_renderColorPickerItem( |
| 306 | 322 | esc_html__( 'Color', 'visualizer' ), |
| @@ -314,10 +330,12 @@ | ||
| 314 | 330 | self::_renderTextItem( |
| 315 | 331 | esc_html__( 'Count', 'visualizer' ), |
| 316 | 332 | 'hAxis[minorGridlines][count]', |
| 317 | 333 | isset( $this->hAxis['minorGridlines']['count'] ) ? $this->hAxis['minorGridlines']['count'] : '', |
| 318 | - esc_html__( 'The number of vertical minor gridlines between two regular gridlines.', 'visualizer' ), | |
| 319 | - 0 | |
| 334 | + esc_html__( 'Specify 0 to disable the minor gridlines.', 'visualizer' ), | |
| 335 | + 0, | |
| 336 | + 'number', | |
| 337 | + array( 'min' => 0, 'max' => 1, 'step' => 1 ) | |
| 320 | 338 | ); |
| 321 | 339 | |
| 322 | 340 | self::_renderColorPickerItem( |
| 323 | 341 | esc_html__( 'Color', 'visualizer' ), |
| @@ -327,9 +345,9 @@ | ||
| 327 | 345 | ); |
| 328 | 346 | self::_renderSectionEnd(); |
| 329 | 347 | } |
| 330 | 348 | |
| 331 | - if ( $this->_horizontalGridLines ) { | |
| 349 | + if ( $this->_verticalGridLines ) { | |
| 332 | 350 | self::_renderSectionStart( esc_html__( 'View Window', 'visualizer' ), false ); |
| 333 | 351 | self::_renderTextItem( |
| 334 | 352 | esc_html__( 'Maximum Value', 'visualizer' ), |
| 335 | 353 | 'vAxis[viewWindow][max]', |
| @@ -368,8 +386,12 @@ | ||
| 368 | 386 | * @access protected |
| 369 | 387 | */ |
| 370 | 388 | protected function _renderSeriesSettings() { |
| 371 | 389 | self::_renderGroupStart( esc_html__( 'Series Settings', 'visualizer' ) ); |
| 390 | + self::_renderSectionStart(); | |
| 391 | + self::_renderSectionDescription( esc_html__( 'If you have just updated/modified the chart data, you may need to save it before the new data reflects in the settings.', 'visualizer' ), 'viz-info-msg' ); | |
| 392 | + self::_renderSectionEnd(); | |
| 393 | + | |
| 372 | 394 | for ( $i = 1, $cnt = count( $this->__series ); $i < $cnt; $i++ ) { |
| 373 | 395 | if ( ! empty( $this->__series[ $i ]['label'] ) ) { |
| 374 | 396 | self::_renderSectionStart( esc_html( $this->__series[ $i ]['label'] ), false ); |
| 375 | 397 | $this->_renderSeries( $i - 1 ); |
| @@ -407,8 +429,11 @@ | ||
| 407 | 429 | 'series[' . $index . '][color]', |
| 408 | 430 | isset( $this->series[ $index ]['color'] ) ? $this->series[ $index ]['color'] : null, |
| 409 | 431 | null |
| 410 | 432 | ); |
| 433 | + | |
| 434 | + $this->_renderRoleField( $index ); | |
| 435 | + | |
| 411 | 436 | } |
| 412 | 437 | |
| 413 | 438 | /** |
| 414 | 439 | * Renders format field for horizontal axis. |