| @@ -18,8 +18,10 @@ | ||
| 18 | 18 | // | MA 02110-1301 USA | |
| 19 | 19 | // +----------------------------------------------------------------------+ |
| 20 | 20 | // | Author: Eugene Manuilov <eugene@manuilov.org> | |
| 21 | 21 | // +----------------------------------------------------------------------+ |
| 22 | + | |
| 23 | + | |
| 22 | 24 | /** |
| 23 | 25 | * Base class for sidebar settigns of graph based charts. |
| 24 | 26 | * |
| 25 | 27 | * @category Visualizer |
| @@ -76,11 +78,11 @@ | ||
| 76 | 78 | $this->_horizontalGridLines = true; |
| 77 | 79 | |
| 78 | 80 | $this->_positions = array( |
| 79 | 81 | '' => '', |
| 80 | - 'in' => esc_html__( 'Inside the chart', 'visualizer' ), | |
| 81 | - 'out' => esc_html__( 'Outside the chart', 'visualizer' ), | |
| 82 | - 'none' => esc_html__( 'None', 'visualizer' ), | |
| 82 | + 'in' => esc_html__( 'Inside the chart', Visualizer_Plugin::NAME ), | |
| 83 | + 'out' => esc_html__( 'Outside the chart', Visualizer_Plugin::NAME ), | |
| 84 | + 'none' => esc_html__( 'None', Visualizer_Plugin::NAME ), | |
| 83 | 85 | ); |
| 84 | 86 | } |
| 85 | 87 | |
| 86 | 88 | /** |
| @@ -90,82 +92,29 @@ | ||
| 90 | 92 | * |
| 91 | 93 | * @access protected |
| 92 | 94 | */ |
| 93 | 95 | protected function _renderChartTitleSettings() { |
| 94 | - self::_renderTextItem( | |
| 95 | - esc_html__( 'Chart Title', 'visualizer' ), | |
| 96 | - 'title', | |
| 97 | - $this->title, | |
| 98 | - esc_html__( 'Text to display above the chart.', 'visualizer' ) | |
| 99 | - ); | |
| 96 | + parent::_renderChartTitleSettings(); | |
| 100 | 97 | |
| 101 | 98 | self::_renderSelectItem( |
| 102 | - esc_html__( 'Chart Title Position', 'visualizer' ), | |
| 99 | + esc_html__( 'Chart Title Position', Visualizer_Plugin::NAME ), | |
| 103 | 100 | 'titlePosition', |
| 104 | 101 | $this->titlePosition, |
| 105 | 102 | $this->_positions, |
| 106 | - esc_html__( 'Where to place the chart title, compared to the chart area.', 'visualizer' ) | |
| 103 | + esc_html__( 'Where to place the chart title, compared to the chart area.', Visualizer_Plugin::NAME ) | |
| 107 | 104 | ); |
| 108 | 105 | |
| 109 | - self::_renderColorPickerItem( | |
| 110 | - esc_html__( 'Chart Title Color', 'visualizer' ), | |
| 111 | - 'titleTextStyle[color]', | |
| 112 | - isset( $this->titleTextStyle['color'] ) ? $this->titleTextStyle['color'] : null, | |
| 113 | - '#000' | |
| 114 | - ); | |
| 106 | + echo '<div class="section-delimiter"></div>'; | |
| 115 | 107 | |
| 116 | - echo '<div class="viz-section-delimiter"></div>'; | |
| 117 | - | |
| 118 | 108 | self::_renderSelectItem( |
| 119 | - esc_html__( 'Axes Titles Position', 'visualizer' ), | |
| 109 | + esc_html__( 'Axes Titles Position', Visualizer_Plugin::NAME ), | |
| 120 | 110 | 'axisTitlesPosition', |
| 121 | 111 | $this->axisTitlesPosition, |
| 122 | 112 | $this->_positions, |
| 123 | - esc_html__( 'Determines where to place the axis titles, compared to the chart area.', 'visualizer' ) | |
| 113 | + esc_html__( 'Determines where to place the axis titles, compared to the chart area.', Visualizer_Plugin::NAME ) | |
| 124 | 114 | ); |
| 125 | - } | |
| 126 | 115 | |
| 127 | - /** | |
| 128 | - * Renders general settings block for horizontal axis settings. | |
| 129 | - * | |
| 130 | - * @since 1.4.0 | |
| 131 | - * | |
| 132 | - * @access protected | |
| 133 | - */ | |
| 134 | - protected function _renderHorizontalAxisGeneralSettings() { | |
| 135 | - self::_renderTextItem( | |
| 136 | - esc_html__( 'Axis Title', 'visualizer' ), | |
| 137 | - 'hAxis[title]', | |
| 138 | - isset( $this->hAxis['title'] ) ? $this->hAxis['title'] : '', | |
| 139 | - esc_html__( 'The title of the horizontal axis.', 'visualizer' ) | |
| 140 | - ); | |
| 141 | - | |
| 142 | - self::_renderSelectItem( | |
| 143 | - esc_html__( 'Text Position', 'visualizer' ), | |
| 144 | - 'vAxis[textPosition]', | |
| 145 | - isset( $this->vAxis['textPosition'] ) ? $this->vAxis['textPosition'] : '', | |
| 146 | - $this->_positions, | |
| 147 | - esc_html__( 'Position of the horizontal axis text, relative to the chart area.', 'visualizer' ) | |
| 148 | - ); | |
| 149 | - | |
| 150 | - self::_renderSelectItem( | |
| 151 | - esc_html__( 'Direction', 'visualizer' ), | |
| 152 | - 'hAxis[direction]', | |
| 153 | - isset( $this->hAxis['direction'] ) ? $this->hAxis['direction'] : '', | |
| 154 | - array( | |
| 155 | - '' => '', | |
| 156 | - '1' => esc_html__( 'Identical Direction', 'visualizer' ), | |
| 157 | - '-1' => esc_html__( 'Reverse Direction', 'visualizer' ), | |
| 158 | - ), | |
| 159 | - esc_html__( 'The direction in which the values along the horizontal axis grow.', 'visualizer' ) | |
| 160 | - ); | |
| 161 | - | |
| 162 | - self::_renderColorPickerItem( | |
| 163 | - esc_html__( 'Base Line Color', 'visualizer' ), | |
| 164 | - 'vAxis[baselineColor]', | |
| 165 | - isset( $this->vAxis['baselineColor'] ) ? $this->vAxis['baselineColor'] : null, | |
| 166 | - '#000' | |
| 167 | - ); | |
| 116 | + echo '<div class="section-delimiter"></div>'; | |
| 168 | 117 | } |
| 169 | 118 | |
| 170 | 119 | /** |
| 171 | 120 | * Renders horizontal axis settings. |
| @@ -174,110 +123,99 @@ | ||
| 174 | 123 | * |
| 175 | 124 | * @access protected |
| 176 | 125 | */ |
| 177 | 126 | protected function _renderHorizontalAxisSettings() { |
| 178 | - self::_renderGroupStart( esc_html__( 'Horizontal Axis Settings', 'visualizer' ) ); | |
| 179 | - self::_renderSectionStart( esc_html__( 'General Settings', 'visualizer' ), false ); | |
| 180 | - $this->_renderHorizontalAxisGeneralSettings(); | |
| 181 | - self::_renderSectionEnd(); | |
| 127 | + self::_renderGroupStart( esc_html__( 'Horizontal Axis Settings', Visualizer_Plugin::NAME ) ); | |
| 128 | + self::_renderSectionStart( esc_html__( 'General Settings', Visualizer_Plugin::NAME ), false ); | |
| 129 | + self::_renderTextItem( | |
| 130 | + esc_html__( 'Axis Title', Visualizer_Plugin::NAME ), | |
| 131 | + 'hAxis[title]', | |
| 132 | + isset( $this->hAxis['title'] ) ? $this->hAxis['title'] : '', | |
| 133 | + esc_html__( 'The title of the horizontal axis.', Visualizer_Plugin::NAME ) | |
| 134 | + ); | |
| 182 | 135 | |
| 183 | - if ( $this->_horizontalGridLines ) { | |
| 184 | - self::_renderSectionStart( esc_html__( 'Grid Lines', 'visualizer' ), false ); | |
| 185 | - self::_renderTextItem( | |
| 186 | - esc_html__( 'Count', 'visualizer' ), | |
| 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 | |
| 191 | - ); | |
| 136 | + self::_renderSelectItem( | |
| 137 | + esc_html__( 'Text Position', Visualizer_Plugin::NAME ), | |
| 138 | + 'vAxis[textPosition]', | |
| 139 | + isset( $this->vAxis['textPosition'] ) ? $this->vAxis['textPosition'] : '', | |
| 140 | + $this->_positions, | |
| 141 | + esc_html__( 'Position of the horizontal axis text, relative to the chart area.', Visualizer_Plugin::NAME ) | |
| 142 | + ); | |
| 192 | 143 | |
| 193 | - self::_renderColorPickerItem( | |
| 194 | - esc_html__( 'Color', 'visualizer' ), | |
| 195 | - 'vAxis[gridlines][color]', | |
| 196 | - isset( $this->vAxis['gridlines']['color'] ) ? $this->vAxis['gridlines']['color'] : null, | |
| 197 | - '#ccc' | |
| 198 | - ); | |
| 199 | - self::_renderSectionEnd(); | |
| 144 | + self::_renderSelectItem( | |
| 145 | + esc_html__( 'Direction', Visualizer_Plugin::NAME ), | |
| 146 | + 'hAxis[direction]', | |
| 147 | + isset( $this->hAxis['direction'] ) ? $this->hAxis['direction'] : '', | |
| 148 | + array( | |
| 149 | + '' => '', | |
| 150 | + '1' => esc_html__( 'Identical Direction', Visualizer_Plugin::NAME ), | |
| 151 | + '-1' => esc_html__( 'Reverse Direction', Visualizer_Plugin::NAME ), | |
| 152 | + ), | |
| 153 | + esc_html__( 'The direction in which the values along the horizontal axis grow.', Visualizer_Plugin::NAME ) | |
| 154 | + ); | |
| 200 | 155 | |
| 201 | - self::_renderSectionStart( esc_html__( 'Minor Grid Lines', 'visualizer' ), false ); | |
| 202 | - self::_renderTextItem( | |
| 203 | - 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 | |
| 208 | - ); | |
| 209 | - | |
| 210 | - self::_renderColorPickerItem( | |
| 211 | - esc_html__( 'Color', 'visualizer' ), | |
| 212 | - 'vAxis[minorGridlines][color]', | |
| 213 | - isset( $this->vAxis['minorGridlines']['color'] ) ? $this->vAxis['minorGridlines']['color'] : null, | |
| 214 | - null | |
| 215 | - ); | |
| 156 | + self::_renderColorPickerItem( | |
| 157 | + esc_html__( 'Base Line Color', Visualizer_Plugin::NAME ), | |
| 158 | + 'vAxis[baselineColor]', | |
| 159 | + isset( $this->vAxis['baselineColor'] ) ? $this->vAxis['baselineColor'] : null, | |
| 160 | + '#000' | |
| 161 | + ); | |
| 216 | 162 | self::_renderSectionEnd(); |
| 217 | - } | |
| 218 | 163 | |
| 219 | - if ( $this->_verticalGridLines ) { | |
| 220 | - self::_renderSectionStart( esc_html__( 'View Window', 'visualizer' ), false ); | |
| 221 | - self::_renderTextItem( | |
| 222 | - esc_html__( 'Maximum Value', 'visualizer' ), | |
| 223 | - 'hAxis[viewWindow][max]', | |
| 224 | - isset( $this->hAxis['viewWindow']['max'] ) ? $this->hAxis['viewWindow']['max'] : '', | |
| 225 | - 'The maximum vertical data value to render.' | |
| 226 | - ); | |
| 164 | + if ( $this->_horizontalGridLines ) { | |
| 165 | + self::_renderSectionStart( esc_html__( 'Grid Lines', Visualizer_Plugin::NAME ), false ); | |
| 166 | + self::_renderTextItem( | |
| 167 | + esc_html__( 'Count', Visualizer_Plugin::NAME ), | |
| 168 | + 'vAxis[gridlines][count]', | |
| 169 | + isset( $this->vAxis['gridlines']['count'] ) ? $this->vAxis['gridlines']['count'] : '', | |
| 170 | + 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_Plugin::NAME ), | |
| 171 | + 5 | |
| 172 | + ); | |
| 227 | 173 | |
| 228 | - self::_renderTextItem( | |
| 229 | - esc_html__( 'Minimum Value', 'visualizer' ), | |
| 230 | - 'hAxis[viewWindow][min]', | |
| 231 | - isset( $this->hAxis['viewWindow']['min'] ) ? $this->hAxis['viewWindow']['min'] : '', | |
| 232 | - 'The minimum vertical data value to render.' | |
| 233 | - ); | |
| 234 | - self::_renderSectionEnd(); | |
| 235 | - } | |
| 236 | - self::_renderGroupEnd(); | |
| 237 | - } | |
| 174 | + self::_renderColorPickerItem( | |
| 175 | + esc_html__( 'Color', Visualizer_Plugin::NAME ), | |
| 176 | + 'vAxis[gridlines][color]', | |
| 177 | + isset( $this->vAxis['gridlines']['color'] ) ? $this->vAxis['gridlines']['color'] : null, | |
| 178 | + '#ccc' | |
| 179 | + ); | |
| 180 | + self::_renderSectionEnd(); | |
| 238 | 181 | |
| 239 | - /** | |
| 240 | - * Renders general settings block for vertical axis settings. | |
| 241 | - * | |
| 242 | - * @since 1.4.0 | |
| 243 | - * | |
| 244 | - * @access protected | |
| 245 | - */ | |
| 246 | - protected function _renderVerticalAxisGeneralSettings() { | |
| 247 | - self::_renderTextItem( | |
| 248 | - esc_html__( 'Axis Title', 'visualizer' ), | |
| 249 | - 'vAxis[title]', | |
| 250 | - isset( $this->vAxis['title'] ) ? $this->vAxis['title'] : '', | |
| 251 | - esc_html__( 'The title of the vertical axis.', 'visualizer' ) | |
| 252 | - ); | |
| 182 | + self::_renderSectionStart( esc_html__( 'Minor Grid Lines', Visualizer_Plugin::NAME ), false ); | |
| 183 | + self::_renderTextItem( | |
| 184 | + esc_html__( 'Count', Visualizer_Plugin::NAME ), | |
| 185 | + 'vAxis[minorGridlines][count]', | |
| 186 | + isset( $this->vAxis['minorGridlines']['count'] ) ? $this->vAxis['minorGridlines']['count'] : '', | |
| 187 | + esc_html__( 'The number of horizontal minor gridlines between two regular gridlines.', Visualizer_Plugin::NAME ), | |
| 188 | + 0 | |
| 189 | + ); | |
| 253 | 190 | |
| 254 | - self::_renderSelectItem( | |
| 255 | - esc_html__( 'Text Position', 'visualizer' ), | |
| 256 | - 'hAxis[textPosition]', | |
| 257 | - isset( $this->hAxis['textPosition'] ) ? $this->hAxis['textPosition'] : '', | |
| 258 | - $this->_positions, | |
| 259 | - esc_html__( 'Position of the vertical axis text, relative to the chart area.', 'visualizer' ) | |
| 260 | - ); | |
| 191 | + self::_renderColorPickerItem( | |
| 192 | + esc_html__( 'Color', Visualizer_Plugin::NAME ), | |
| 193 | + 'vAxis[minorGridlines][color]', | |
| 194 | + isset( $this->vAxis['minorGridlines']['color'] ) ? $this->vAxis['minorGridlines']['color'] : null, | |
| 195 | + null | |
| 196 | + ); | |
| 197 | + self::_renderSectionEnd(); | |
| 198 | + } | |
| 261 | 199 | |
| 262 | - self::_renderSelectItem( | |
| 263 | - esc_html__( 'Direction', 'visualizer' ), | |
| 264 | - 'vAxis[direction]', | |
| 265 | - isset( $this->vAxis['direction'] ) ? $this->vAxis['direction'] : '', | |
| 266 | - array( | |
| 267 | - '' => '', | |
| 268 | - '1' => esc_html__( 'Identical Direction', 'visualizer' ), | |
| 269 | - '-1' => esc_html__( 'Reverse Direction', 'visualizer' ), | |
| 270 | - ), | |
| 271 | - esc_html__( 'The direction in which the values along the vertical axis grow.', 'visualizer' ) | |
| 272 | - ); | |
| 200 | + if ( $this->_verticalGridLines ) { | |
| 201 | + self::_renderSectionStart( esc_html__( 'View Window', Visualizer_Plugin::NAME ), false ); | |
| 202 | + self::_renderTextItem( | |
| 203 | + esc_html__( 'Maximum Value', Visualizer_Plugin::NAME ), | |
| 204 | + 'hAxis[viewWindow][max]', | |
| 205 | + isset( $this->hAxis['viewWindow']['max'] ) ? $this->hAxis['viewWindow']['max'] : '', | |
| 206 | + 'The maximum vertical data value to render.' | |
| 207 | + ); | |
| 273 | 208 | |
| 274 | - self::_renderColorPickerItem( | |
| 275 | - esc_html__( 'Base Line Color', 'visualizer' ), | |
| 276 | - 'hAxis[baselineColor]', | |
| 277 | - isset( $this->hAxis['baselineColor'] ) ? $this->hAxis['baselineColor'] : null, | |
| 278 | - '#000' | |
| 279 | - ); | |
| 209 | + self::_renderTextItem( | |
| 210 | + esc_html__( 'Minimum Value', Visualizer_Plugin::NAME ), | |
| 211 | + 'hAxis[viewWindow][min]', | |
| 212 | + isset( $this->hAxis['viewWindow']['min'] ) ? $this->hAxis['viewWindow']['min'] : '', | |
| 213 | + 'The minimum vertical data value to render.' | |
| 214 | + ); | |
| 215 | + self::_renderSectionEnd(); | |
| 216 | + } | |
| 217 | + self::_renderGroupEnd(); | |
| 280 | 218 | } |
| 281 | 219 | |
| 282 | 220 | /** |
| 283 | 221 | * Renders vertical axis settings. |
| @@ -286,66 +224,98 @@ | ||
| 286 | 224 | * |
| 287 | 225 | * @access protected |
| 288 | 226 | */ |
| 289 | 227 | protected function _renderVerticalAxisSettings() { |
| 290 | - self::_renderGroupStart( esc_html__( 'Vertical Axis Settings', 'visualizer' ) ); | |
| 291 | - self::_renderSectionStart( esc_html__( 'General Settings', 'visualizer' ), false ); | |
| 292 | - $this->_renderVerticalAxisGeneralSettings(); | |
| 228 | + self::_renderGroupStart( esc_html__( 'Vertical Axis Settings', Visualizer_Plugin::NAME ) ); | |
| 229 | + self::_renderSectionStart( esc_html__( 'General Settings', Visualizer_Plugin::NAME ), false ); | |
| 230 | + self::_renderTextItem( | |
| 231 | + esc_html__( 'Axis Title', Visualizer_Plugin::NAME ), | |
| 232 | + 'vAxis[title]', | |
| 233 | + isset( $this->vAxis['title'] ) ? $this->vAxis['title'] : '', | |
| 234 | + esc_html__( 'The title of the vertical axis.', Visualizer_Plugin::NAME ) | |
| 235 | + ); | |
| 236 | + | |
| 237 | + self::_renderSelectItem( | |
| 238 | + esc_html__( 'Text Position', Visualizer_Plugin::NAME ), | |
| 239 | + 'hAxis[textPosition]', | |
| 240 | + isset( $this->hAxis['textPosition'] ) ? $this->hAxis['textPosition'] : '', | |
| 241 | + $this->_positions, | |
| 242 | + esc_html__( 'Position of the vertical axis text, relative to the chart area.', Visualizer_Plugin::NAME ) | |
| 243 | + ); | |
| 244 | + | |
| 245 | + self::_renderSelectItem( | |
| 246 | + esc_html__( 'Direction', Visualizer_Plugin::NAME ), | |
| 247 | + 'vAxis[direction]', | |
| 248 | + isset( $this->vAxis['direction'] ) ? $this->vAxis['direction'] : '', | |
| 249 | + array( | |
| 250 | + '' => '', | |
| 251 | + '1' => esc_html__( 'Identical Direction', Visualizer_Plugin::NAME ), | |
| 252 | + '-1' => esc_html__( 'Reverse Direction', Visualizer_Plugin::NAME ), | |
| 253 | + ), | |
| 254 | + esc_html__( 'The direction in which the values along the vertical axis grow.', Visualizer_Plugin::NAME ) | |
| 255 | + ); | |
| 256 | + | |
| 257 | + self::_renderColorPickerItem( | |
| 258 | + esc_html__( 'Base Line Color', Visualizer_Plugin::NAME ), | |
| 259 | + 'hAxis[baselineColor]', | |
| 260 | + isset( $this->hAxis['baselineColor'] ) ? $this->hAxis['baselineColor'] : null, | |
| 261 | + '#000' | |
| 262 | + ); | |
| 293 | 263 | self::_renderSectionEnd(); |
| 294 | 264 | |
| 295 | - if ( $this->_verticalGridLines ) { | |
| 296 | - self::_renderSectionStart( esc_html__( 'Grid Lines', 'visualizer' ), false ); | |
| 297 | - self::_renderTextItem( | |
| 298 | - esc_html__( 'Count', 'visualizer' ), | |
| 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 | |
| 303 | - ); | |
| 265 | + if ( $this->_verticalGridLines ) { | |
| 266 | + self::_renderSectionStart( esc_html__( 'Grid Lines', Visualizer_Plugin::NAME ), false ); | |
| 267 | + self::_renderTextItem( | |
| 268 | + esc_html__( 'Count', Visualizer_Plugin::NAME ), | |
| 269 | + 'hAxis[gridlines][count]', | |
| 270 | + isset( $this->hAxis['gridlines']['count'] ) ? $this->hAxis['gridlines']['count'] : '', | |
| 271 | + 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_Plugin::NAME ), | |
| 272 | + 5 | |
| 273 | + ); | |
| 304 | 274 | |
| 305 | - self::_renderColorPickerItem( | |
| 306 | - esc_html__( 'Color', 'visualizer' ), | |
| 307 | - 'hAxis[gridlines][color]', | |
| 308 | - isset( $this->hAxis['gridlines']['color'] ) ? $this->hAxis['gridlines']['color'] : null, | |
| 309 | - '#ccc' | |
| 310 | - ); | |
| 311 | - self::_renderSectionEnd(); | |
| 275 | + self::_renderColorPickerItem( | |
| 276 | + esc_html__( 'Color', Visualizer_Plugin::NAME ), | |
| 277 | + 'hAxis[gridlines][color]', | |
| 278 | + isset( $this->hAxis['gridlines']['color'] ) ? $this->hAxis['gridlines']['color'] : null, | |
| 279 | + '#ccc' | |
| 280 | + ); | |
| 281 | + self::_renderSectionEnd(); | |
| 312 | 282 | |
| 313 | - self::_renderSectionStart( esc_html__( 'Minor Grid Lines', 'visualizer' ), false ); | |
| 314 | - self::_renderTextItem( | |
| 315 | - 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 | |
| 320 | - ); | |
| 283 | + self::_renderSectionStart( esc_html__( 'Minor Grid Lines', Visualizer_Plugin::NAME ), false ); | |
| 284 | + self::_renderTextItem( | |
| 285 | + esc_html__( 'Count', Visualizer_Plugin::NAME ), | |
| 286 | + 'hAxis[minorGridlines][count]', | |
| 287 | + isset( $this->hAxis['minorGridlines']['count'] ) ? $this->hAxis['minorGridlines']['count'] : '', | |
| 288 | + esc_html__( 'The number of vertical minor gridlines between two regular gridlines.', Visualizer_Plugin::NAME ), | |
| 289 | + 0 | |
| 290 | + ); | |
| 321 | 291 | |
| 322 | - self::_renderColorPickerItem( | |
| 323 | - esc_html__( 'Color', 'visualizer' ), | |
| 324 | - 'hAxis[minorGridlines][color]', | |
| 325 | - isset( $this->hAxis['minorGridlines']['color'] ) ? $this->hAxis['minorGridlines']['color'] : null, | |
| 326 | - null | |
| 327 | - ); | |
| 328 | - self::_renderSectionEnd(); | |
| 329 | - } | |
| 292 | + self::_renderColorPickerItem( | |
| 293 | + esc_html__( 'Color', Visualizer_Plugin::NAME ), | |
| 294 | + 'hAxis[minorGridlines][color]', | |
| 295 | + isset( $this->hAxis['minorGridlines']['color'] ) ? $this->hAxis['minorGridlines']['color'] : null, | |
| 296 | + null | |
| 297 | + ); | |
| 298 | + self::_renderSectionEnd(); | |
| 299 | + } | |
| 330 | 300 | |
| 331 | - if ( $this->_horizontalGridLines ) { | |
| 332 | - self::_renderSectionStart( esc_html__( 'View Window', 'visualizer' ), false ); | |
| 333 | - self::_renderTextItem( | |
| 334 | - esc_html__( 'Maximum Value', 'visualizer' ), | |
| 335 | - 'vAxis[viewWindow][max]', | |
| 336 | - isset( $this->vAxis['viewWindow']['max'] ) ? $this->vAxis['viewWindow']['max'] : '', | |
| 337 | - 'The maximum vertical data value to render.' | |
| 338 | - ); | |
| 301 | + if ( $this->_horizontalGridLines ) { | |
| 302 | + self::_renderSectionStart( esc_html__( 'View Window', Visualizer_Plugin::NAME ), false ); | |
| 303 | + self::_renderTextItem( | |
| 304 | + esc_html__( 'Maximum Value', Visualizer_Plugin::NAME ), | |
| 305 | + 'vAxis[viewWindow][max]', | |
| 306 | + isset( $this->vAxis['viewWindow']['max'] ) ? $this->vAxis['viewWindow']['max'] : '', | |
| 307 | + 'The maximum vertical data value to render.' | |
| 308 | + ); | |
| 339 | 309 | |
| 340 | - self::_renderTextItem( | |
| 341 | - esc_html__( 'Minimum Value', 'visualizer' ), | |
| 342 | - 'vAxis[viewWindow][min]', | |
| 343 | - isset( $this->vAxis['viewWindow']['min'] ) ? $this->vAxis['viewWindow']['min'] : '', | |
| 344 | - 'The minimum vertical data value to render.' | |
| 345 | - ); | |
| 346 | - self::_renderSectionEnd(); | |
| 347 | - } | |
| 310 | + self::_renderTextItem( | |
| 311 | + esc_html__( 'Minimum Value', Visualizer_Plugin::NAME ), | |
| 312 | + 'vAxis[viewWindow][min]', | |
| 313 | + isset( $this->vAxis['viewWindow']['min'] ) ? $this->vAxis['viewWindow']['min'] : '', | |
| 314 | + 'The minimum vertical data value to render.' | |
| 315 | + ); | |
| 316 | + self::_renderSectionEnd(); | |
| 317 | + } | |
| 348 | 318 | self::_renderGroupEnd(); |
| 349 | 319 | } |
| 350 | 320 | |
| 351 | 321 | /** |
| @@ -367,16 +337,16 @@ | ||
| 367 | 337 | * |
| 368 | 338 | * @access protected |
| 369 | 339 | */ |
| 370 | 340 | protected function _renderSeriesSettings() { |
| 371 | - self::_renderGroupStart( esc_html__( 'Series Settings', 'visualizer' ) ); | |
| 372 | - for ( $i = 1, $cnt = count( $this->__series ); $i < $cnt; $i++ ) { | |
| 373 | - if ( ! empty( $this->__series[ $i ]['label'] ) ) { | |
| 374 | - self::_renderSectionStart( esc_html( $this->__series[ $i ]['label'] ), false ); | |
| 375 | - $this->_renderSeries( $i - 1 ); | |
| 376 | - self::_renderSectionEnd(); | |
| 341 | + self::_renderGroupStart( esc_html__( 'Series Settings', Visualizer_Plugin::NAME ) ); | |
| 342 | + for ( $i = 1, $cnt = count( $this->__series ); $i < $cnt; $i++ ) { | |
| 343 | + if ( !empty( $this->__series[$i]['label'] ) ) { | |
| 344 | + self::_renderSectionStart( esc_html( $this->__series[$i]['label'] ), false ); | |
| 345 | + $this->_renderSeries( $i - 1 ); | |
| 346 | + self::_renderSectionEnd(); | |
| 347 | + } | |
| 377 | 348 | } |
| 378 | - } | |
| 379 | 349 | self::_renderGroupEnd(); |
| 380 | 350 | } |
| 381 | 351 | |
| 382 | 352 | /** |
| @@ -388,84 +358,24 @@ | ||
| 388 | 358 | * @param int $index The series index. |
| 389 | 359 | */ |
| 390 | 360 | protected function _renderSeries( $index ) { |
| 391 | 361 | self::_renderSelectItem( |
| 392 | - esc_html__( 'Visible In Legend', 'visualizer' ), | |
| 362 | + esc_html__( 'Visible In Legend', Visualizer_Plugin::NAME ), | |
| 393 | 363 | 'series[' . $index . '][visibleInLegend]', |
| 394 | - isset( $this->series[ $index ]['visibleInLegend'] ) ? $this->series[ $index ]['visibleInLegend'] : '', | |
| 364 | + isset( $this->series[$index]['visibleInLegend'] ) ? $this->series[$index]['visibleInLegend'] : '', | |
| 395 | 365 | array( |
| 396 | 366 | '' => '', |
| 397 | - '0' => esc_html__( 'No', 'visualizer' ), | |
| 398 | - '1' => esc_html__( 'Yes', 'visualizer' ), | |
| 367 | + '0' => esc_html__( 'No', Visualizer_Plugin::NAME ), | |
| 368 | + '1' => esc_html__( 'Yes', Visualizer_Plugin::NAME ), | |
| 399 | 369 | ), |
| 400 | - esc_html__( 'Determines whether the series has to be presented in the legend or not.', 'visualizer' ) | |
| 370 | + esc_html__( 'Determines whether the series has to be presented in the legend or not.', Visualizer_Plugin::NAME ) | |
| 401 | 371 | ); |
| 402 | 372 | |
| 403 | - $this->_renderFormatField( $index ); | |
| 404 | - | |
| 405 | 373 | self::_renderColorPickerItem( |
| 406 | - esc_html__( 'Color', 'visualizer' ), | |
| 374 | + esc_html__( 'Color', Visualizer_Plugin::NAME ), | |
| 407 | 375 | 'series[' . $index . '][color]', |
| 408 | - isset( $this->series[ $index ]['color'] ) ? $this->series[ $index ]['color'] : null, | |
| 376 | + isset( $this->series[$index]['color'] ) ? $this->series[$index]['color'] : null, | |
| 409 | 377 | null |
| 410 | 378 | ); |
| 411 | 379 | } |
| 412 | 380 | |
| 413 | - /** | |
| 414 | - * Renders format field for horizontal axis. | |
| 415 | - * | |
| 416 | - * @since 1.4.3 | |
| 417 | - * | |
| 418 | - * @access protected | |
| 419 | - */ | |
| 420 | - protected function _renderHorizontalAxisFormatField() { | |
| 421 | - self::_renderTextItem( | |
| 422 | - esc_html__( 'Number Format', 'visualizer' ), | |
| 423 | - 'hAxis[format]', | |
| 424 | - isset( $this->hAxis['format'] ) ? $this->hAxis['format'] : '', | |
| 425 | - sprintf( | |
| 426 | - '%s<br><br>%s<br><br>%s', | |
| 427 | - esc_html__( 'Enter custom format pattern to apply to horizontal axis labels.', 'visualizer' ), | |
| 428 | - sprintf( | |
| 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' ), | |
| 430 | - '<a href="http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details" target="_blank">', | |
| 431 | - '</a>' | |
| 432 | - ), | |
| 433 | - sprintf( | |
| 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">', | |
| 436 | - '</a>' | |
| 437 | - ) | |
| 438 | - ) | |
| 439 | - ); | |
| 440 | - } | |
| 441 | - | |
| 442 | - /** | |
| 443 | - * Renders format field for vertical axis settings. | |
| 444 | - * | |
| 445 | - * @since 1.4.3 | |
| 446 | - * | |
| 447 | - * @access protected | |
| 448 | - */ | |
| 449 | - protected function _renderVerticalAxisFormatField() { | |
| 450 | - self::_renderTextItem( | |
| 451 | - esc_html__( 'Number Format', 'visualizer' ), | |
| 452 | - 'vAxis[format]', | |
| 453 | - isset( $this->vAxis['format'] ) ? $this->vAxis['format'] : '', | |
| 454 | - sprintf( | |
| 455 | - '%s<br><br>%s<br><br>%s', | |
| 456 | - esc_html__( 'Enter custom format pattern to apply to vertical axis labels.', 'visualizer' ), | |
| 457 | - sprintf( | |
| 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' ), | |
| 459 | - '<a href="http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details" target="_blank">', | |
| 460 | - '</a>' | |
| 461 | - ), | |
| 462 | - sprintf( | |
| 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">', | |
| 465 | - '</a>' | |
| 466 | - ) | |
| 467 | - ) | |
| 468 | - ); | |
| 469 | - } | |
| 470 | - | |
| 471 | -} | |
| 381 | +} | |