|
| 1 | +<?php |
| 2 | + |
| 3 | +// +----------------------------------------------------------------------+ |
| 4 | +// | Copyright 2013 Madpixels (email : [email protected]) | |
| 5 | +// +----------------------------------------------------------------------+ |
| 6 | +// | This program is free software; you can redistribute it and/or modify | |
| 7 | +// | it under the terms of the GNU General Public License, version 2, as | |
| 8 | +// | published by the Free Software Foundation. | |
| 9 | +// | | |
| 10 | +// | This program is distributed in the hope that it will be useful, | |
| 11 | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 13 | +// | GNU General Public License for more details. | |
| 14 | +// | | |
| 15 | +// | You should have received a copy of the GNU General Public License | |
| 16 | +// | along with this program; if not, write to the Free Software | |
| 17 | +// | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, | |
| 18 | +// | MA 02110-1301 USA | |
| 19 | +// +----------------------------------------------------------------------+ |
| 20 | +// | Author: Eugene Manuilov <[email protected]> | |
| 21 | +// +----------------------------------------------------------------------+ |
| 22 | +/** |
| 23 | + * Class for area chart sidebar settings. |
| 24 | + * |
| 25 | + * @category Visualizer |
| 26 | + * @package Render |
| 27 | + * @subpackage Sidebar |
| 28 | + * |
| 29 | + * @since 1.0.0 |
| 30 | + */ |
| 31 | +class Visualizer_Render_Sidebar_Type_GoogleCharts_Bubble extends Visualizer_Render_Sidebar_Linear { |
| 32 | + |
| 33 | + /** |
| 34 | + * Constructor. |
| 35 | + * |
| 36 | + * @since 1.0.0 |
| 37 | + * |
| 38 | + * @access public |
| 39 | + * @param array $data The data what has to be associated with this render. |
| 40 | + */ |
| 41 | + public function __construct( $data = array() ) { |
| 42 | + parent::__construct( $data ); |
| 43 | + $this->_includeCurveTypes = false; |
| 44 | + } |
| 45 | + |
| 46 | + /** |
| 47 | + * Renders template. |
| 48 | + * |
| 49 | + * @since 1.0.0 |
| 50 | + * |
| 51 | + * @access protected |
| 52 | + */ |
| 53 | + protected function _toHTML() { |
| 54 | + $this->_renderGeneralSettings(); |
| 55 | + $this->_renderAxesSettings(); |
| 56 | + $this->_renderBubbleSettings(); |
| 57 | + $this->_renderViewSettings(); |
| 58 | + $this->_renderAdvancedSettings(); |
| 59 | + } |
| 60 | + |
| 61 | + /** |
| 62 | + * Renders bubble settings items. |
| 63 | + * |
| 64 | + * @since 3.4.0 |
| 65 | + * |
| 66 | + * @access protected |
| 67 | + */ |
| 68 | + protected function _renderBubbleSettings() { |
| 69 | + self::_renderGroupStart( esc_html__( 'Bubble Settings', 'visualizer' ) ); |
| 70 | + self::_renderSectionStart(); |
| 71 | + self::_renderTextItem( |
| 72 | + esc_html__( 'Opacity', 'visualizer' ), |
| 73 | + 'bubble[opacity]', |
| 74 | + isset( $this->bubble['opacity'] ) ? $this->bubble['opacity'] : 0.8, |
| 75 | + esc_html__( 'The default opacity of the bubbles, where 0.0 is fully transparent and 1.0 is fully opaque.', 'visualizer' ), |
| 76 | + 0.8, |
| 77 | + 'number', |
| 78 | + array( 'min' => 0.0, 'max' => 1.0, 'step' => 0.1 ) |
| 79 | + ); |
| 80 | + |
| 81 | + self::_renderColorPickerItem( |
| 82 | + esc_html__( 'Stroke Color', 'visualizer' ), |
| 83 | + 'bubble[stroke]', |
| 84 | + isset( $this->bubble[ $index ]['stroke'] ) ? $this->bubble[ $index ]['stroke'] : null, |
| 85 | + null |
| 86 | + ); |
| 87 | + |
| 88 | + self::_renderCheckboxItem( |
| 89 | + esc_html__( 'Sort Bubbles by Size', 'visualizer' ), |
| 90 | + 'sortBubblesBySize', |
| 91 | + $this->sortBubblesBySize ? 1 : 0, |
| 92 | + 1, |
| 93 | + esc_html__( 'If true, sorts the bubbles by size so the smaller bubbles appear above the larger bubbles. If false, bubbles are sorted according to their order in the DataTable.', 'visualizer' ) |
| 94 | + ); |
| 95 | + |
| 96 | + self::_renderTextItem( |
| 97 | + esc_html__( 'Size (max)', 'visualizer' ), |
| 98 | + 'sizeAxis[maxValue]', |
| 99 | + isset( $this->sizeAxis['maxValue'] ) ? $this->sizeAxis['maxValue'] : '', |
| 100 | + esc_html__( 'The size value (as appears in the chart data) to be mapped to sizeAxis.maxSize. Larger values will be cropped to this value.', 'visualizer' ), |
| 101 | + '', |
| 102 | + 'number', |
| 103 | + array( 'step' => 1 ) |
| 104 | + ); |
| 105 | + |
| 106 | + self::_renderTextItem( |
| 107 | + esc_html__( 'Size (min)', 'visualizer' ), |
| 108 | + 'sizeAxis[minValue]', |
| 109 | + isset( $this->sizeAxis['minValue'] ) ? $this->sizeAxis['minValue'] : '', |
| 110 | + esc_html__( 'The size value (as appears in the chart data) to be mapped to sizeAxis.minSize. Smaller values will be cropped to this value.', 'visualizer' ), |
| 111 | + '', |
| 112 | + 'number', |
| 113 | + array( 'step' => 1 ) |
| 114 | + ); |
| 115 | + |
| 116 | + self::_renderSectionEnd(); |
| 117 | + self::_renderGroupEnd(); |
| 118 | + |
| 119 | + } |
| 120 | + |
| 121 | + |
| 122 | +} |
0 commit comments