| @@ -37,8 +37,9 @@ | ||
| 37 | 37 | 'bottom' => esc_html__( 'Below the chart', 'visualizer' ), |
| 38 | 38 | 'bottom' => esc_html__( 'Below the chart', 'visualizer' ), |
| 39 | 39 | 'none' => esc_html__( 'Omit the legend', 'visualizer' ), |
| 40 | 40 | ); |
| 41 | + | |
| 41 | 42 | } |
| 42 | 43 | |
| 43 | 44 | /** |
| 44 | 45 | * Renders concrete series settings for the Bar chart. |
| @@ -76,9 +77,9 @@ | ||
| 76 | 77 | |
| 77 | 78 | /** |
| 78 | 79 | * Loads the assets. |
| 79 | 80 | */ |
| 80 | - public function load_chartjs_assets( $deps, $is_frontend ) { | |
| 81 | + function load_chartjs_assets( $deps, $is_frontend ) { | |
| 81 | 82 | $this->load_dependent_assets( array( 'moment', 'numeral' ) ); |
| 82 | 83 | |
| 83 | 84 | wp_register_script( 'chartjs', VISUALIZER_ABSURL . 'js/lib/chartjs.min.js', array( 'numeral', 'moment' ), null, true ); |
| 84 | 85 | wp_register_script( |
| @@ -94,8 +95,9 @@ | ||
| 94 | 95 | return array_merge( |
| 95 | 96 | $deps, |
| 96 | 97 | array( 'visualizer-render-chartjs-lib' ) |
| 97 | 98 | ); |
| 99 | + | |
| 98 | 100 | } |
| 99 | 101 | |
| 100 | 102 | /** |
| 101 | 103 | * Renders series settings group. |
| @@ -130,8 +132,9 @@ | ||
| 130 | 132 | */ |
| 131 | 133 | protected function _renderSeries( $index ) { |
| 132 | 134 | $this->_renderFormatField( $index ); |
| 133 | 135 | $this->_renderChartTypeSeries( $index ); |
| 136 | + | |
| 134 | 137 | } |
| 135 | 138 | |
| 136 | 139 | /** |
| 137 | 140 | * Renders template. |
| @@ -183,8 +186,9 @@ | ||
| 183 | 186 | '<a href="https://developers.google.com/search/docs/data-types/dataset#dataset" target="_blank">', |
| 184 | 187 | '</a>' |
| 185 | 188 | ) |
| 186 | 189 | ); |
| 190 | + | |
| 187 | 191 | } |
| 188 | 192 | |
| 189 | 193 | /** |
| 190 | 194 | * Renders chart general settings group. |
| @@ -205,9 +209,9 @@ | ||
| 205 | 209 | |
| 206 | 210 | self::_renderSectionStart( esc_html__( 'Font Styles', 'visualizer' ), false ); |
| 207 | 211 | echo '<div class="viz-section-item">'; |
| 208 | 212 | echo '<a class="more-info" href="javascript:;">[?]</a>'; |
| 209 | - echo '<b>', esc_html__( 'Font Family And Size', 'visualizer' ), '</b>'; | |
| 213 | + echo '<b>', esc_html__( 'Family And Size', 'visualizer' ), '</b>'; | |
| 210 | 214 | |
| 211 | 215 | echo '<table class="viz-section-table" cellspacing="0" cellpadding="0" border="0">'; |
| 212 | 216 | echo '<tr>'; |
| 213 | 217 | echo '<td class="viz-section-table-column">'; |
| @@ -243,9 +247,9 @@ | ||
| 243 | 247 | 'legend[position]', |
| 244 | 248 | // let's have a default otherwise the chart behaves weird when hovering in edit mode |
| 245 | 249 | isset( $this->legend['position'] ) ? $this->legend['position'] : 'top', |
| 246 | 250 | $this->_legendPositions, |
| 247 | - esc_html__( 'Sets the legend position relative to the chart.', 'visualizer' ) | |
| 251 | + esc_html__( 'Determines where to place the legend, compared to the chart area.', 'visualizer' ) | |
| 248 | 252 | ); |
| 249 | 253 | |
| 250 | 254 | self::_renderCheckboxItem( |
| 251 | 255 | esc_html__( 'Show datasets in reverse order', 'visualizer' ), |
| @@ -256,9 +260,9 @@ | ||
| 256 | 260 | ); |
| 257 | 261 | |
| 258 | 262 | echo '<div class="viz-section-item">'; |
| 259 | 263 | echo '<a class="more-info" href="javascript:;">[?]</a>'; |
| 260 | - echo '<b>', esc_html__( 'Font Family And Size', 'visualizer' ), '</b>'; | |
| 264 | + echo '<b>', esc_html__( 'Family And Size', 'visualizer' ), '</b>'; | |
| 261 | 265 | |
| 262 | 266 | echo '<table class="viz-section-table" cellspacing="0" cellpadding="0" border="0">'; |
| 263 | 267 | echo '<tr>'; |
| 264 | 268 | echo '<td class="viz-section-table-column">'; |
| @@ -362,8 +366,9 @@ | ||
| 362 | 366 | esc_html__( 'The easing function applied to the animation.', 'visualizer' ) |
| 363 | 367 | ); |
| 364 | 368 | |
| 365 | 369 | self::_renderSectionEnd(); |
| 370 | + | |
| 366 | 371 | } |
| 367 | 372 | |
| 368 | 373 | /** |
| 369 | 374 | * Renders tooltip settings section. |
| @@ -389,9 +394,9 @@ | ||
| 389 | 394 | self::_renderSectionStart(); |
| 390 | 395 | self::_renderSectionDescription( |
| 391 | 396 | '<span class="viz-gvlink">' . sprintf( |
| 392 | 397 | // translators: %1$s - HTML link tag, %2$s - HTML closing link tag, %3$s - HTML link tag, %4$s - HTML closing link tag. |
| 393 | - __( 'Configure the graph by providing configuration variables right from the %1$sChartJS API%2$s. You can refer to %3$sCommon Snippets%4$s for examples.', 'visualizer' ), | |
| 398 | + __( 'Configure the graph by providing configuration variables right from the %1$sChartJS API%2$s. You can refer to to some examples %3$shere%4$s.', 'visualizer' ), | |
| 394 | 399 | '<a href="https://www.chartjs.org/docs/latest/configuration/" target="_blank">', |
| 395 | 400 | '</a>', |
| 396 | 401 | '<a href="https://docs.themeisle.com/article/728-manual-configuration" target="_blank">', |
| 397 | 402 | '</a>' |
| @@ -402,15 +407,12 @@ | ||
| 402 | 407 | /** |
| 403 | 408 | * Add the correct example for the manual configuration box. |
| 404 | 409 | */ |
| 405 | 410 | protected function _renderManualConfigExample() { |
| 406 | - return json_encode( | |
| 407 | - array( | |
| 408 | - 'cutoutPercentage' => 5, | |
| 409 | - 'rotation' => 60, | |
| 410 | - ), | |
| 411 | - JSON_PRETTY_PRINT | |
| 412 | - ); | |
| 411 | + return '{ | |
| 412 | + "cutoutPercentage": 5, | |
| 413 | + "rotation": 60 | |
| 414 | + }'; | |
| 413 | 415 | } |
| 414 | 416 | |
| 415 | 417 | /** |
| 416 | 418 | * Renders chart view settings group. |