| @@ -28,9 +28,9 @@ | ||
| 28 | 28 | * |
| 29 | 29 | * @since 1.0.0 |
| 30 | 30 | * @abstract |
| 31 | 31 | */ |
| 32 | -abstract class Visualizer_Render_Sidebar_Graph extends Visualizer_Render_Sidebar_Google { | |
| 32 | +abstract class Visualizer_Render_Sidebar_Graph extends Visualizer_Render_Sidebar { | |
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * Determines whether we need to render vertical gridlines options or not. |
| 36 | 36 | * |
| @@ -112,9 +112,9 @@ | ||
| 112 | 112 | isset( $this->titleTextStyle['color'] ) ? $this->titleTextStyle['color'] : null, |
| 113 | 113 | '#000' |
| 114 | 114 | ); |
| 115 | 115 | |
| 116 | - echo '<div class="viz-section-delimiter"></div>'; | |
| 116 | + echo '<div class="section-delimiter"></div>'; | |
| 117 | 117 | |
| 118 | 118 | self::_renderSelectItem( |
| 119 | 119 | esc_html__( 'Axes Titles Position', 'visualizer' ), |
| 120 | 120 | 'axisTitlesPosition', |
| @@ -121,18 +121,8 @@ | ||
| 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 | - | |
| 135 | 125 | } |
| 136 | 126 | |
| 137 | 127 | /** |
| 138 | 128 | * Renders general settings block for horizontal axis settings. |
| @@ -149,36 +139,11 @@ | ||
| 149 | 139 | esc_html__( 'The title of the horizontal axis.', 'visualizer' ) |
| 150 | 140 | ); |
| 151 | 141 | |
| 152 | 142 | self::_renderSelectItem( |
| 153 | - esc_html__( 'Slanted Text', 'visualizer' ), | |
| 154 | - 'hAxis[slantedText]', | |
| 155 | - isset( $this->hAxis['slantedText'] ) ? $this->hAxis['slantedText'] : false, | |
| 156 | - array( | |
| 157 | - false => 'False', | |
| 158 | - true => 'True', | |
| 159 | - ), | |
| 160 | - '', | |
| 161 | - false | |
| 162 | - ); | |
| 163 | - | |
| 164 | - self::_renderTextItem( | |
| 165 | - esc_html__( 'Slanted Text Angle', 'visualizer' ), | |
| 166 | - 'hAxis[slantedTextAngle]', | |
| 167 | - isset( $this->hAxis['slantedTextAngle'] ) ? $this->hAxis['slantedTextAngle'] : 45, | |
| 168 | - '', | |
| 169 | - 45, | |
| 170 | - 'number', | |
| 171 | - array( | |
| 172 | - 'min' => 1, | |
| 173 | - 'step' => 15, | |
| 174 | - ) | |
| 175 | - ); | |
| 176 | - | |
| 177 | - self::_renderSelectItem( | |
| 178 | 143 | esc_html__( 'Text Position', 'visualizer' ), |
| 179 | - 'hAxis[textPosition]', | |
| 180 | - isset( $this->hAxis['textPosition'] ) ? $this->hAxis['textPosition'] : '', | |
| 144 | + 'vAxis[textPosition]', | |
| 145 | + isset( $this->vAxis['textPosition'] ) ? $this->vAxis['textPosition'] : '', | |
| 181 | 146 | $this->_positions, |
| 182 | 147 | esc_html__( 'Position of the horizontal axis text, relative to the chart area.', 'visualizer' ) |
| 183 | 148 | ); |
| 184 | 149 | |
| @@ -213,24 +178,23 @@ | ||
| 213 | 178 | self::_renderGroupStart( esc_html__( 'Horizontal Axis Settings', 'visualizer' ) ); |
| 214 | 179 | self::_renderSectionStart( esc_html__( 'General Settings', 'visualizer' ), false ); |
| 215 | 180 | $this->_renderHorizontalAxisGeneralSettings(); |
| 216 | 181 | self::_renderSectionEnd(); |
| 182 | + | |
| 217 | 183 | if ( $this->_horizontalGridLines ) { |
| 218 | 184 | self::_renderSectionStart( esc_html__( 'Grid Lines', 'visualizer' ), false ); |
| 219 | 185 | self::_renderTextItem( |
| 220 | 186 | esc_html__( 'Count', 'visualizer' ), |
| 221 | - 'hAxis[gridlines][count]', | |
| 222 | - isset( $this->hAxis['gridlines']['count'] ) ? $this->hAxis['gridlines']['count'] : '', | |
| 223 | - 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' ), | |
| 224 | - 5, | |
| 225 | - 'number', | |
| 226 | - array( 'min' => -1, 'max' => 1000, 'step' => 1 ) | |
| 187 | + 'vAxis[gridlines][count]', | |
| 188 | + isset( $this->vAxis['gridlines']['count'] ) ? $this->vAxis['gridlines']['count'] : '', | |
| 189 | + 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' ), | |
| 190 | + 5 | |
| 227 | 191 | ); |
| 228 | 192 | |
| 229 | 193 | self::_renderColorPickerItem( |
| 230 | 194 | esc_html__( 'Color', 'visualizer' ), |
| 231 | - 'hAxis[gridlines][color]', | |
| 232 | - isset( $this->hAxis['gridlines']['color'] ) ? $this->hAxis['gridlines']['color'] : null, | |
| 195 | + 'vAxis[gridlines][color]', | |
| 196 | + isset( $this->vAxis['gridlines']['color'] ) ? $this->vAxis['gridlines']['color'] : null, | |
| 233 | 197 | '#ccc' |
| 234 | 198 | ); |
| 235 | 199 | self::_renderSectionEnd(); |
| 236 | 200 | |
| @@ -236,26 +200,24 @@ | ||
| 236 | 200 | |
| 237 | 201 | self::_renderSectionStart( esc_html__( 'Minor Grid Lines', 'visualizer' ), false ); |
| 238 | 202 | self::_renderTextItem( |
| 239 | 203 | esc_html__( 'Count', 'visualizer' ), |
| 240 | - 'hAxis[minorGridlines][count]', | |
| 241 | - isset( $this->hAxis['minorGridlines']['count'] ) ? $this->hAxis['minorGridlines']['count'] : '', | |
| 242 | - esc_html__( 'Specify 0 to disable the minor gridlines.', 'visualizer' ), | |
| 243 | - 0, | |
| 244 | - 'number', | |
| 245 | - array( 'min' => 0, 'step' => 1 ) | |
| 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 | |
| 246 | 208 | ); |
| 247 | 209 | |
| 248 | 210 | self::_renderColorPickerItem( |
| 249 | 211 | esc_html__( 'Color', 'visualizer' ), |
| 250 | - 'hAxis[minorGridlines][color]', | |
| 251 | - isset( $this->hAxis['minorGridlines']['color'] ) ? $this->hAxis['minorGridlines']['color'] : null, | |
| 212 | + 'vAxis[minorGridlines][color]', | |
| 213 | + isset( $this->vAxis['minorGridlines']['color'] ) ? $this->vAxis['minorGridlines']['color'] : null, | |
| 252 | 214 | null |
| 253 | 215 | ); |
| 254 | 216 | self::_renderSectionEnd(); |
| 255 | 217 | } |
| 256 | 218 | |
| 257 | - if ( $this->_horizontalGridLines ) { | |
| 219 | + if ( $this->_verticalGridLines ) { | |
| 258 | 220 | self::_renderSectionStart( esc_html__( 'View Window', 'visualizer' ), false ); |
| 259 | 221 | self::_renderTextItem( |
| 260 | 222 | esc_html__( 'Maximum Value', 'visualizer' ), |
| 261 | 223 | 'hAxis[viewWindow][max]', |
| @@ -290,10 +252,10 @@ | ||
| 290 | 252 | ); |
| 291 | 253 | |
| 292 | 254 | self::_renderSelectItem( |
| 293 | 255 | esc_html__( 'Text Position', 'visualizer' ), |
| 294 | - 'vAxis[textPosition]', | |
| 295 | - isset( $this->vAxis['textPosition'] ) ? $this->vAxis['textPosition'] : '', | |
| 256 | + 'hAxis[textPosition]', | |
| 257 | + isset( $this->hAxis['textPosition'] ) ? $this->hAxis['textPosition'] : '', | |
| 296 | 258 | $this->_positions, |
| 297 | 259 | esc_html__( 'Position of the vertical axis text, relative to the chart area.', 'visualizer' ) |
| 298 | 260 | ); |
| 299 | 261 | |
| @@ -333,20 +295,18 @@ | ||
| 333 | 295 | if ( $this->_verticalGridLines ) { |
| 334 | 296 | self::_renderSectionStart( esc_html__( 'Grid Lines', 'visualizer' ), false ); |
| 335 | 297 | self::_renderTextItem( |
| 336 | 298 | esc_html__( 'Count', 'visualizer' ), |
| 337 | - 'vAxis[gridlines][count]', | |
| 338 | - isset( $this->vAxis['gridlines']['count'] ) ? $this->vAxis['gridlines']['count'] : '', | |
| 339 | - 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' ), | |
| 340 | - 5, | |
| 341 | - 'number', | |
| 342 | - array( 'min' => -1, 'max' => 1000, 'step' => 1 ) | |
| 299 | + 'hAxis[gridlines][count]', | |
| 300 | + isset( $this->hAxis['gridlines']['count'] ) ? $this->hAxis['gridlines']['count'] : '', | |
| 301 | + 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' ), | |
| 302 | + 5 | |
| 343 | 303 | ); |
| 344 | 304 | |
| 345 | 305 | self::_renderColorPickerItem( |
| 346 | 306 | esc_html__( 'Color', 'visualizer' ), |
| 347 | - 'vAxis[gridlines][color]', | |
| 348 | - isset( $this->vAxis['gridlines']['color'] ) ? $this->vAxis['gridlines']['color'] : null, | |
| 307 | + 'hAxis[gridlines][color]', | |
| 308 | + isset( $this->hAxis['gridlines']['color'] ) ? $this->hAxis['gridlines']['color'] : null, | |
| 349 | 309 | '#ccc' |
| 350 | 310 | ); |
| 351 | 311 | self::_renderSectionEnd(); |
| 352 | 312 | |
| @@ -352,26 +312,24 @@ | ||
| 352 | 312 | |
| 353 | 313 | self::_renderSectionStart( esc_html__( 'Minor Grid Lines', 'visualizer' ), false ); |
| 354 | 314 | self::_renderTextItem( |
| 355 | 315 | esc_html__( 'Count', 'visualizer' ), |
| 356 | - 'vAxis[minorGridlines][count]', | |
| 357 | - isset( $this->vAxis['minorGridlines']['count'] ) ? $this->vAxis['minorGridlines']['count'] : '', | |
| 358 | - esc_html__( 'Specify 0 to disable the minor gridlines.', 'visualizer' ), | |
| 359 | - 0, | |
| 360 | - 'number', | |
| 361 | - array( 'min' => 0, 'step' => 1 ) | |
| 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 | |
| 362 | 320 | ); |
| 363 | 321 | |
| 364 | 322 | self::_renderColorPickerItem( |
| 365 | 323 | esc_html__( 'Color', 'visualizer' ), |
| 366 | - 'vAxis[minorGridlines][color]', | |
| 367 | - isset( $this->vAxis['minorGridlines']['color'] ) ? $this->vAxis['minorGridlines']['color'] : null, | |
| 324 | + 'hAxis[minorGridlines][color]', | |
| 325 | + isset( $this->hAxis['minorGridlines']['color'] ) ? $this->hAxis['minorGridlines']['color'] : null, | |
| 368 | 326 | null |
| 369 | 327 | ); |
| 370 | 328 | self::_renderSectionEnd(); |
| 371 | 329 | } |
| 372 | 330 | |
| 373 | - if ( $this->_verticalGridLines ) { | |
| 331 | + if ( $this->_horizontalGridLines ) { | |
| 374 | 332 | self::_renderSectionStart( esc_html__( 'View Window', 'visualizer' ), false ); |
| 375 | 333 | self::_renderTextItem( |
| 376 | 334 | esc_html__( 'Maximum Value', 'visualizer' ), |
| 377 | 335 | 'vAxis[viewWindow][max]', |
| @@ -410,12 +368,8 @@ | ||
| 410 | 368 | * @access protected |
| 411 | 369 | */ |
| 412 | 370 | protected function _renderSeriesSettings() { |
| 413 | 371 | self::_renderGroupStart( esc_html__( 'Series Settings', 'visualizer' ) ); |
| 414 | - self::_renderSectionStart(); | |
| 415 | - 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' ); | |
| 416 | - self::_renderSectionEnd(); | |
| 417 | - | |
| 418 | 372 | for ( $i = 1, $cnt = count( $this->__series ); $i < $cnt; $i++ ) { |
| 419 | 373 | if ( ! empty( $this->__series[ $i ]['label'] ) ) { |
| 420 | 374 | self::_renderSectionStart( esc_html( $this->__series[ $i ]['label'] ), false ); |
| 421 | 375 | $this->_renderSeries( $i - 1 ); |
| @@ -453,11 +407,8 @@ | ||
| 453 | 407 | 'series[' . $index . '][color]', |
| 454 | 408 | isset( $this->series[ $index ]['color'] ) ? $this->series[ $index ]['color'] : null, |
| 455 | 409 | null |
| 456 | 410 | ); |
| 457 | - | |
| 458 | - $this->_renderRoleField( $index ); | |
| 459 | - | |
| 460 | 411 | } |
| 461 | 412 | |
| 462 | 413 | /** |
| 463 | 414 | * Renders format field for horizontal axis. |
| @@ -474,15 +425,15 @@ | ||
| 474 | 425 | sprintf( |
| 475 | 426 | '%s<br><br>%s<br><br>%s', |
| 476 | 427 | esc_html__( 'Enter custom format pattern to apply to horizontal axis labels.', 'visualizer' ), |
| 477 | 428 | sprintf( |
| 478 | - esc_html__( 'For number axis labels, this is a subset of the decimal formatting %1$sICU pattern set%2$s. For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #%% percentage format then your values will be multiplied by 100.', 'visualizer' ), | |
| 429 | + esc_html__( 'For number axis labels, this is a subset of the decimal formatting %1$sICU pattern set%2$s. For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #%% percentage format then your values will be multiplied by 100.','visualizer' ), | |
| 479 | 430 | '<a href="http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details" target="_blank">', |
| 480 | 431 | '</a>' |
| 481 | 432 | ), |
| 482 | 433 | sprintf( |
| 483 | - esc_html__( 'For date axis labels, this is a subset of the date formatting %1$sICU date and time format%2$s.', 'visualizer' ), | |
| 484 | - '<a href="https://unicode-org.github.io/icu/userguide/format_parse/datetime/#datetime-format-syntax" target="_blank">', | |
| 434 | + esc_html__( 'For date axis labels, this is a subset of the date formatting %1$sICU date and time format%2$s.','visualizer' ), | |
| 435 | + '<a href="http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax" target="_blank">', | |
| 485 | 436 | '</a>' |
| 486 | 437 | ) |
| 487 | 438 | ) |
| 488 | 439 | ); |
| @@ -503,15 +454,15 @@ | ||
| 503 | 454 | sprintf( |
| 504 | 455 | '%s<br><br>%s<br><br>%s', |
| 505 | 456 | esc_html__( 'Enter custom format pattern to apply to vertical axis labels.', 'visualizer' ), |
| 506 | 457 | sprintf( |
| 507 | - esc_html__( 'For number axis labels, this is a subset of the decimal formatting %1$sICU pattern set%2$s. For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #%% percentage format then your values will be multiplied by 100.', 'visualizer' ), | |
| 458 | + esc_html__( 'For number axis labels, this is a subset of the decimal formatting %1$sICU pattern set%2$s. For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #%% percentage format then your values will be multiplied by 100.','visualizer' ), | |
| 508 | 459 | '<a href="http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details" target="_blank">', |
| 509 | 460 | '</a>' |
| 510 | 461 | ), |
| 511 | 462 | sprintf( |
| 512 | - esc_html__( 'For date axis labels, this is a subset of the date formatting %1$sICU date and time format%2$s.', 'visualizer' ), | |
| 513 | - '<a href="https://unicode-org.github.io/icu/userguide/format_parse/datetime/#datetime-format-syntax" target="_blank">', | |
| 463 | + esc_html__( 'For date axis labels, this is a subset of the date formatting %1$sICU date and time format%2$s.','visualizer' ), | |
| 464 | + '<a href="http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax" target="_blank">', | |
| 514 | 465 | '</a>' |
| 515 | 466 | ) |
| 516 | 467 | ) |
| 517 | 468 | ); |