PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 1.1.1
Visualizer – Tables & Charts Manager with Built-in AI Generator v1.1.1
4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 3.10.4 All 148 releases
visualizer / classes / Visualizer / Render / Sidebar / Linear.php

Linear.php in Visualizer – Tables & Charts Manager with Built-in AI Generator 1.1.1, at classes/Visualizer/Render/Sidebar/Linear.php

206 lines 6.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // +----------------------------------------------------------------------+
4 // | Copyright 2013 Madpixels (email : visualizer@madpixels.net) |
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 <eugene@manuilov.org> |
21 // +----------------------------------------------------------------------+
22
23
24 /**
25 * Base class for sidebar settings of linear based charts.
26 *
27 * @category Visualizer
28 * @package Render
29 * @subpackage Sidebar
30 *
31 * @since 1.0.0
32 * @abstract
33 */
34 abstract class Visualizer_Render_Sidebar_Linear extends Visualizer_Render_Sidebar_Graph {
35
36 /**
37 * Determines whether we need to render curve type option or not.
38 *
39 * @since 1.0.0
40 *
41 * @access protected
42 * @var boolean
43 */
44 protected $_includeCurveTypes;
45
46 /**
47 * The array of available curve types.
48 *
49 * @since 1.0.0
50 *
51 * @access protected
52 * @var array
53 */
54 protected $_curveTypes;
55
56 /**
57 * Determines whether we need to render focus target option or not.
58 *
59 * @since 1.0.0
60 *
61 * @access protected
62 * @var boolean
63 */
64 protected $_includeFocusTarget;
65
66 /**
67 * Constructor.
68 *
69 * @since 1.0.0
70 *
71 * @access public
72 * @param array $data The data what has to be associated with this render.
73 */
74 public function __construct( $data = array() ) {
75 parent::__construct( $data );
76
77 $this->_includeCurveTypes = true;
78 $this->_includeFocusTarget = true;
79
80 $this->_curveTypes = array(
81 '' => '',
82 'none' => esc_html__( 'Straight line without curve', Visualizer_Plugin::NAME ),
83 'function' => esc_html__( 'The angles of the line will be smoothed', Visualizer_Plugin::NAME ),
84 );
85 }
86
87 /**
88 * Renders line settings items.
89 *
90 * @since 1.0.0
91 *
92 * @access protected
93 */
94 protected function _renderLineSettingsItems() {
95 self::_renderTextItem(
96 esc_html__( 'Line Width', Visualizer_Plugin::NAME ),
97 'lineWidth',
98 $this->lineWidth,
99 esc_html__( 'Data line width in pixels. Use zero to hide all lines and show only the points.', Visualizer_Plugin::NAME ),
100 2
101 );
102
103 self::_renderTextItem(
104 esc_html__( 'Point Size', Visualizer_Plugin::NAME ),
105 'pointSize',
106 $this->pointSize,
107 esc_html__( 'Diameter of displayed points in pixels. Use zero to hide all points.', Visualizer_Plugin::NAME ),
108 0
109 );
110
111 if ( $this->_includeCurveTypes ) {
112 self::_renderSelectItem(
113 esc_html__( 'Curve Type', Visualizer_Plugin::NAME ),
114 'curveType',
115 $this->curveType,
116 $this->_curveTypes,
117 esc_html__( 'Determines whether the series has to be presented in the legend or not.', Visualizer_Plugin::NAME )
118 );
119 }
120
121 if ( $this->_includeFocusTarget ) {
122 self::_renderSelectItem(
123 esc_html__( 'Focus Target', Visualizer_Plugin::NAME ),
124 'focusTarget',
125 $this->focusTarget,
126 array(
127 '' => '',
128 'datum' => esc_html__( 'Focus on a single data point.', Visualizer_Plugin::NAME ),
129 'category' => esc_html__( 'Focus on a grouping of all data points along the major axis.', Visualizer_Plugin::NAME ),
130 ),
131 esc_html__( 'The type of the entity that receives focus on mouse hover. Also affects which entity is selected by mouse click.', Visualizer_Plugin::NAME )
132 );
133 }
134 }
135
136 /**
137 * Renders lines settings.
138 *
139 * @since 1.0.0
140 *
141 * @access protected
142 */
143 protected function _renderLineSettings() {
144 self::_renderGroupStart( esc_html__( 'Lines Settings', Visualizer_Plugin::NAME ) );
145 self::_renderSectionStart();
146 $this->_renderLineSettingsItems();
147 self::_renderSectionEnd();
148 self::_renderGroupEnd();
149 }
150
151 /**
152 * Renders concreate series settings.
153 *
154 * @since 1.0.0
155 *
156 * @access protected
157 * @param int $index The series index.
158 */
159 protected function _renderSeries( $index ) {
160 self::_renderSelectItem(
161 esc_html__( 'Visible In Legend', Visualizer_Plugin::NAME ),
162 'series[' . $index . '][visibleInLegend]',
163 isset( $this->series[$index]['visibleInLegend'] ) ? $this->series[$index]['visibleInLegend'] : '',
164 array(
165 '' => '',
166 '0' => esc_html__( 'No', Visualizer_Plugin::NAME ),
167 '1' => esc_html__( 'Yes', Visualizer_Plugin::NAME ),
168 ),
169 esc_html__( 'Determines whether the series has to be presented in the legend or not.', Visualizer_Plugin::NAME )
170 );
171
172 self::_renderTextItem(
173 esc_html__( 'Line Width', Visualizer_Plugin::NAME ),
174 'series[' . $index . '][lineWidth]',
175 isset( $this->series[$index]['lineWidth'] ) ? $this->series[$index]['lineWidth'] : '',
176 esc_html__( 'Overrides the global line width value for this series.', Visualizer_Plugin::NAME ),
177 2
178 );
179
180 self::_renderTextItem(
181 esc_html__( 'Point Size', Visualizer_Plugin::NAME ),
182 'series[' . $index . '][pointSize]',
183 isset( $this->series[$index]['pointSize'] ) ? $this->series[$index]['pointSize'] : '',
184 esc_html__( 'Overrides the global point size value for this series.', Visualizer_Plugin::NAME ),
185 0
186 );
187
188 if ( $this->_includeCurveTypes ) {
189 self::_renderSelectItem(
190 esc_html__( 'Curve Type', Visualizer_Plugin::NAME ),
191 'series[' . $index . '][curveType]',
192 isset( $this->series[$index]['curveType'] ) ? $this->series[$index]['curveType'] : '',
193 $this->_curveTypes,
194 esc_html__( 'Determines whether the series has to be presented in the legend or not.', Visualizer_Plugin::NAME )
195 );
196 }
197
198 self::_renderColorPickerItem(
199 esc_html__( 'Color', Visualizer_Plugin::NAME ),
200 'series[' . $index . '][color]',
201 isset( $this->series[$index]['color'] ) ? $this->series[$index]['color'] : null,
202 null
203 );
204 }
205
206 }