| @@ -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. |
| @@ -176,15 +179,11 @@ | ||
| 176 | 179 | self::_renderTextAreaItem( |
| 177 | 180 | esc_html__( 'Chart Description', 'visualizer' ), |
| 178 | 181 | 'description', |
| 179 | 182 | $this->description, |
| 180 | - sprintf( | |
| 181 | - // translators: %1$s - HTML link tag, %2$s - HTML closing link tag. | |
| 182 | - esc_html__( 'Description to display in the structured data schema as explained %1$shere%2$s', 'visualizer' ), | |
| 183 | - '<a href="https://developers.google.com/search/docs/data-types/dataset#dataset" target="_blank">', | |
| 184 | - '</a>' | |
| 185 | - ) | |
| 183 | + 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>' ) | |
| 186 | 184 | ); |
| 185 | + | |
| 187 | 186 | } |
| 188 | 187 | |
| 189 | 188 | /** |
| 190 | 189 | * Renders chart general settings group. |
| @@ -205,9 +204,9 @@ | ||
| 205 | 204 | |
| 206 | 205 | self::_renderSectionStart( esc_html__( 'Font Styles', 'visualizer' ), false ); |
| 207 | 206 | echo '<div class="viz-section-item">'; |
| 208 | 207 | echo '<a class="more-info" href="javascript:;">[?]</a>'; |
| 209 | - echo '<b>', esc_html__( 'Font Family And Size', 'visualizer' ), '</b>'; | |
| 208 | + echo '<b>', esc_html__( 'Family And Size', 'visualizer' ), '</b>'; | |
| 210 | 209 | |
| 211 | 210 | echo '<table class="viz-section-table" cellspacing="0" cellpadding="0" border="0">'; |
| 212 | 211 | echo '<tr>'; |
| 213 | 212 | echo '<td class="viz-section-table-column">'; |
| @@ -243,9 +242,9 @@ | ||
| 243 | 242 | 'legend[position]', |
| 244 | 243 | // let's have a default otherwise the chart behaves weird when hovering in edit mode |
| 245 | 244 | isset( $this->legend['position'] ) ? $this->legend['position'] : 'top', |
| 246 | 245 | $this->_legendPositions, |
| 247 | - esc_html__( 'Sets the legend position relative to the chart.', 'visualizer' ) | |
| 246 | + esc_html__( 'Determines where to place the legend, compared to the chart area.', 'visualizer' ) | |
| 248 | 247 | ); |
| 249 | 248 | |
| 250 | 249 | self::_renderCheckboxItem( |
| 251 | 250 | esc_html__( 'Show datasets in reverse order', 'visualizer' ), |
| @@ -256,9 +255,9 @@ | ||
| 256 | 255 | ); |
| 257 | 256 | |
| 258 | 257 | echo '<div class="viz-section-item">'; |
| 259 | 258 | echo '<a class="more-info" href="javascript:;">[?]</a>'; |
| 260 | - echo '<b>', esc_html__( 'Font Family And Size', 'visualizer' ), '</b>'; | |
| 259 | + echo '<b>', esc_html__( 'Family And Size', 'visualizer' ), '</b>'; | |
| 261 | 260 | |
| 262 | 261 | echo '<table class="viz-section-table" cellspacing="0" cellpadding="0" border="0">'; |
| 263 | 262 | echo '<tr>'; |
| 264 | 263 | echo '<td class="viz-section-table-column">'; |
| @@ -362,8 +361,9 @@ | ||
| 362 | 361 | esc_html__( 'The easing function applied to the animation.', 'visualizer' ) |
| 363 | 362 | ); |
| 364 | 363 | |
| 365 | 364 | self::_renderSectionEnd(); |
| 365 | + | |
| 366 | 366 | } |
| 367 | 367 | |
| 368 | 368 | /** |
| 369 | 369 | * Renders tooltip settings section. |
| @@ -386,18 +386,9 @@ | ||
| 386 | 386 | * Add the correct description for the manual configuration box. |
| 387 | 387 | */ |
| 388 | 388 | protected function _renderManualConfigDescription() { |
| 389 | 389 | self::_renderSectionStart(); |
| 390 | - self::_renderSectionDescription( | |
| 391 | - '<span class="viz-gvlink">' . sprintf( | |
| 392 | - // 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' ), | |
| 394 | - '<a href="https://www.chartjs.org/docs/latest/configuration/" target="_blank">', | |
| 395 | - '</a>', | |
| 396 | - '<a href="https://docs.themeisle.com/article/728-manual-configuration" target="_blank">', | |
| 397 | - '</a>' | |
| 398 | - ) . '</span>' | |
| 399 | - ); | |
| 390 | + self::_renderSectionDescription( '<span class="viz-gvlink">' . sprintf( __( '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' ), '<a href="https://www.chartjs.org/docs/latest/configuration/" target="_blank">', '</a>', '<a href="https://docs.themeisle.com/article/728-manual-configuration" target="_blank">', '</a>' ) . '</span>' ); | |
| 400 | 391 | } |
| 401 | 392 | |
| 402 | 393 | /** |
| 403 | 394 | * Add the correct example for the manual configuration box. |
| @@ -402,15 +393,12 @@ | ||
| 402 | 393 | /** |
| 403 | 394 | * Add the correct example for the manual configuration box. |
| 404 | 395 | */ |
| 405 | 396 | protected function _renderManualConfigExample() { |
| 406 | - return json_encode( | |
| 407 | - array( | |
| 408 | - 'cutoutPercentage' => 5, | |
| 409 | - 'rotation' => 60, | |
| 410 | - ), | |
| 411 | - JSON_PRETTY_PRINT | |
| 412 | - ); | |
| 397 | + return '{ | |
| 398 | + "cutoutPercentage": 5, | |
| 399 | + "rotation": 60 | |
| 400 | + }'; | |
| 413 | 401 | } |
| 414 | 402 | |
| 415 | 403 | /** |
| 416 | 404 | * Renders chart view settings group. |