| @@ -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. |
| @@ -178,9 +188,8 @@ | ||
| 178 | 188 | self::_renderGroupStart( esc_html__( 'Horizontal Axis Settings', 'visualizer' ) ); |
| 179 | 189 | self::_renderSectionStart( esc_html__( 'General Settings', 'visualizer' ), false ); |
| 180 | 190 | $this->_renderHorizontalAxisGeneralSettings(); |
| 181 | 191 | self::_renderSectionEnd(); |
| 182 | - | |
| 183 | 192 | if ( $this->_horizontalGridLines ) { |
| 184 | 193 | self::_renderSectionStart( esc_html__( 'Grid Lines', 'visualizer' ), false ); |
| 185 | 194 | self::_renderTextItem( |
| 186 | 195 | esc_html__( 'Count', 'visualizer' ), |
| @@ -185,10 +194,12 @@ | ||
| 185 | 194 | self::_renderTextItem( |
| 186 | 195 | esc_html__( 'Count', 'visualizer' ), |
| 187 | 196 | 'hAxis[gridlines][count]', |
| 188 | 197 | 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 | |
| 198 | + 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' ), | |
| 199 | + 5, | |
| 200 | + 'number', | |
| 201 | + array( 'min' => -1, 'max' => 1000, 'step' => 1 ) | |
| 191 | 202 | ); |
| 192 | 203 | |
| 193 | 204 | self::_renderColorPickerItem( |
| 194 | 205 | esc_html__( 'Color', 'visualizer' ), |
| @@ -200,24 +211,26 @@ | ||
| 200 | 211 | |
| 201 | 212 | self::_renderSectionStart( esc_html__( 'Minor Grid Lines', 'visualizer' ), false ); |
| 202 | 213 | self::_renderTextItem( |
| 203 | 214 | esc_html__( 'Count', 'visualizer' ), |
| 204 | - 'vAxis[minorGridlines][count]', | |
| 205 | - 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 | |
| 215 | + 'hAxis[minorGridlines][count]', | |
| 216 | + isset( $this->hAxis['minorGridlines']['count'] ) ? $this->hAxis['minorGridlines']['count'] : '', | |
| 217 | + esc_html__( 'Specify 0 to disable the minor gridlines.', 'visualizer' ), | |
| 218 | + 0, | |
| 219 | + 'number', | |
| 220 | + array( 'min' => 0, 'max' => 1, 'step' => 1 ) | |
| 208 | 221 | ); |
| 209 | 222 | |
| 210 | 223 | self::_renderColorPickerItem( |
| 211 | 224 | esc_html__( 'Color', 'visualizer' ), |
| 212 | - 'vAxis[minorGridlines][color]', | |
| 213 | - isset( $this->vAxis['minorGridlines']['color'] ) ? $this->vAxis['minorGridlines']['color'] : null, | |
| 225 | + 'hAxis[minorGridlines][color]', | |
| 226 | + isset( $this->hAxis['minorGridlines']['color'] ) ? $this->hAxis['minorGridlines']['color'] : null, | |
| 214 | 227 | null |
| 215 | 228 | ); |
| 216 | 229 | self::_renderSectionEnd(); |
| 217 | 230 | } |
| 218 | 231 | |
| 219 | - if ( $this->_verticalGridLines ) { | |
| 232 | + if ( $this->_horizontalGridLines ) { | |
| 220 | 233 | self::_renderSectionStart( esc_html__( 'View Window', 'visualizer' ), false ); |
| 221 | 234 | self::_renderTextItem( |
| 222 | 235 | esc_html__( 'Maximum Value', 'visualizer' ), |
| 223 | 236 | 'hAxis[viewWindow][max]', |
| @@ -297,10 +310,12 @@ | ||
| 297 | 310 | self::_renderTextItem( |
| 298 | 311 | esc_html__( 'Count', 'visualizer' ), |
| 299 | 312 | 'vAxis[gridlines][count]', |
| 300 | 313 | 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 | |
| 314 | + 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' ), | |
| 315 | + 5, | |
| 316 | + 'number', | |
| 317 | + array( 'min' => -1, 'max' => 1000, 'step' => 1 ) | |
| 303 | 318 | ); |
| 304 | 319 | |
| 305 | 320 | self::_renderColorPickerItem( |
| 306 | 321 | esc_html__( 'Color', 'visualizer' ), |
| @@ -312,24 +327,26 @@ | ||
| 312 | 327 | |
| 313 | 328 | self::_renderSectionStart( esc_html__( 'Minor Grid Lines', 'visualizer' ), false ); |
| 314 | 329 | self::_renderTextItem( |
| 315 | 330 | esc_html__( 'Count', 'visualizer' ), |
| 316 | - 'hAxis[minorGridlines][count]', | |
| 317 | - 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 | |
| 331 | + 'vAxis[minorGridlines][count]', | |
| 332 | + isset( $this->vAxis['minorGridlines']['count'] ) ? $this->vAxis['minorGridlines']['count'] : '', | |
| 333 | + esc_html__( 'Specify 0 to disable the minor gridlines.', 'visualizer' ), | |
| 334 | + 0, | |
| 335 | + 'number', | |
| 336 | + array( 'min' => 0, 'max' => 1, 'step' => 1 ) | |
| 320 | 337 | ); |
| 321 | 338 | |
| 322 | 339 | self::_renderColorPickerItem( |
| 323 | 340 | esc_html__( 'Color', 'visualizer' ), |
| 324 | - 'hAxis[minorGridlines][color]', | |
| 325 | - isset( $this->hAxis['minorGridlines']['color'] ) ? $this->hAxis['minorGridlines']['color'] : null, | |
| 341 | + 'vAxis[minorGridlines][color]', | |
| 342 | + isset( $this->vAxis['minorGridlines']['color'] ) ? $this->vAxis['minorGridlines']['color'] : null, | |
| 326 | 343 | null |
| 327 | 344 | ); |
| 328 | 345 | self::_renderSectionEnd(); |
| 329 | 346 | } |
| 330 | 347 | |
| 331 | - if ( $this->_horizontalGridLines ) { | |
| 348 | + if ( $this->_verticalGridLines ) { | |
| 332 | 349 | self::_renderSectionStart( esc_html__( 'View Window', 'visualizer' ), false ); |
| 333 | 350 | self::_renderTextItem( |
| 334 | 351 | esc_html__( 'Maximum Value', 'visualizer' ), |
| 335 | 352 | 'vAxis[viewWindow][max]', |
| @@ -368,8 +385,12 @@ | ||
| 368 | 385 | * @access protected |
| 369 | 386 | */ |
| 370 | 387 | protected function _renderSeriesSettings() { |
| 371 | 388 | self::_renderGroupStart( esc_html__( 'Series Settings', 'visualizer' ) ); |
| 389 | + self::_renderSectionStart(); | |
| 390 | + 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' ); | |
| 391 | + self::_renderSectionEnd(); | |
| 392 | + | |
| 372 | 393 | for ( $i = 1, $cnt = count( $this->__series ); $i < $cnt; $i++ ) { |
| 373 | 394 | if ( ! empty( $this->__series[ $i ]['label'] ) ) { |
| 374 | 395 | self::_renderSectionStart( esc_html( $this->__series[ $i ]['label'] ), false ); |
| 375 | 396 | $this->_renderSeries( $i - 1 ); |
| @@ -407,8 +428,11 @@ | ||
| 407 | 428 | 'series[' . $index . '][color]', |
| 408 | 429 | isset( $this->series[ $index ]['color'] ) ? $this->series[ $index ]['color'] : null, |
| 409 | 430 | null |
| 410 | 431 | ); |
| 432 | + | |
| 433 | + $this->_renderRoleField( $index ); | |
| 434 | + | |
| 411 | 435 | } |
| 412 | 436 | |
| 413 | 437 | /** |
| 414 | 438 | * Renders format field for horizontal axis. |