PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.3.3
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.3.3
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 / Gutenberg / src / Components / Sidebar / VerticalAxisSettings.js

VerticalAxisSettings.js in Visualizer – Tables & Charts Manager with Built-in AI Generator 3.3.3, at classes/Visualizer/Gutenberg/src/Components/Sidebar/VerticalAxisSettings.js

252 lines 6.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * WordPress dependencies
3 */
4 const { __ } = wp.i18n;
5
6 const {
7 Component,
8 Fragment
9 } = wp.element;
10
11 const { ColorPalette } = wp.editor;
12
13 const {
14 BaseControl,
15 ExternalLink,
16 PanelBody,
17 SelectControl,
18 TextControl
19 } = wp.components;
20
21 class VerticalAxisSettings extends Component {
22 constructor() {
23 super( ...arguments );
24 }
25
26 render() {
27
28 const type = this.props.chart['visualizer-chart-type'];
29
30 const settings = this.props.chart['visualizer-settings'];
31
32 return (
33 <PanelBody
34 title={ __( 'Vertical Axis Settings' ) }
35 initialOpen={ false }
36 className="visualizer-advanced-panel"
37 >
38
39 <PanelBody
40 title={ __( 'General Settings' ) }
41 className="visualizer-inner-sections"
42 initialOpen={ false }
43 >
44
45 <TextControl
46 label={ __( 'Axis Title' ) }
47 help={ __( 'The title of the Vertical axis.' ) }
48 value={ settings.vAxis.title }
49 onChange={ e => {
50 settings.vAxis.title = e;
51 this.props.edit( settings );
52 } }
53 />
54
55 <SelectControl
56 label={ __( 'Text Position' ) }
57 help={ __( 'Position of the Vertical axis text, relative to the chart area.' ) }
58 value={ settings.vAxis.textPosition ? settings.vAxis.textPosition : 'out' }
59 options={ [
60 { label: __( 'Inside the chart' ), value: 'in' },
61 { label: __( 'Outside the chart' ), value: 'out' },
62 { label: __( 'None' ), value: 'none' }
63 ] }
64 onChange={ e => {
65 settings.vAxis.textPosition = e;
66 this.props.edit( settings );
67 } }
68 />
69
70 <SelectControl
71 label={ __( 'Direction' ) }
72 help={ __( 'The direction in which the values along the Vertical axis grow.' ) }
73 value={ settings.vAxis.direction ? settings.vAxis.direction : '1' }
74 options={ [
75 { label: __( 'Identical Direction' ), value: '1' },
76 { label: __( 'Reverse Direction' ), value: '-1' }
77 ] }
78 onChange={ e => {
79 settings.vAxis.direction = e;
80 this.props.edit( settings );
81 } }
82 />
83
84 <BaseControl
85 label={ __( 'Base Line Color' ) }
86 >
87 <ColorPalette
88 value={ settings.vAxis.baselineColor }
89 onChange={ e => {
90 settings.vAxis.baselineColor = e;
91 this.props.edit( settings );
92 } }
93 />
94 </BaseControl>
95
96 <BaseControl
97 label={ __( 'Axis Text Color' ) }
98 >
99 <ColorPalette
100 value={ settings.vAxis.textStyle.color || settings.vAxis.textStyle }
101 onChange={ e => {
102 settings.vAxis.textStyle = {};
103 settings.vAxis.textStyle.color = e;
104 this.props.edit( settings );
105 } }
106 />
107 </BaseControl>
108
109 { ( -1 >= [ 'column' ].indexOf( type ) ) && (
110 <Fragment>
111
112 <TextControl
113 label={ __( 'Number Format' ) }
114 help={ __( 'Enter custom format pattern to apply to Vertical axis labels.' ) }
115 value={ settings.vAxis.format }
116 onChange={ e => {
117 settings.vAxis.format = e;
118 this.props.edit( settings );
119 } }
120 />
121
122 <p>
123 { __( 'For number axis labels, this is a subset of the formatting ' ) }
124 <ExternalLink href="http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details">
125 { __( 'ICU pattern set.' ) }
126 </ExternalLink>
127 { __( ' 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.' ) }
128 </p>
129
130 <p>
131 { __( 'For date axis labels, this is a subset of the date formatting ' ) }
132 <ExternalLink href="http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax">
133 { __( 'ICU date and time format.' ) }
134 </ExternalLink>
135 </p>
136
137 </Fragment>
138 ) }
139
140 </PanelBody>
141
142 { ( -1 >= [ 'bar' ].indexOf( type ) ) && (
143
144 <Fragment>
145
146 <PanelBody
147 title={ __( 'Grid Lines' ) }
148 className="visualizer-inner-sections"
149 initialOpen={ false }
150 >
151
152 <TextControl
153 label={ __( 'Count' ) }
154 help={ __( 'The number of Vertical gridlines inside the chart area. Minimum value is 2. Specify -1 to automatically compute the number of gridlines.' ) }
155 value={ settings.vAxis.gridlines ? settings.vAxis.gridlines.count : '' }
156 onChange={ e => {
157 if ( ! settings.vAxis.gridlines ) {
158 settings.vAxis.gridlines = {};
159 }
160
161 settings.vAxis.gridlines.count = e;
162 this.props.edit( settings );
163 } }
164 />
165
166 <BaseControl
167 label={ __( 'Color' ) }
168 >
169 <ColorPalette
170 value={ settings.vAxis.gridlines ? settings.vAxis.gridlines.color : '' }
171 onChange={ e => {
172 if ( ! settings.vAxis.gridlines ) {
173 settings.vAxis.gridlines = {};
174 }
175
176 settings.vAxis.gridlines.color = e;
177 this.props.edit( settings );
178 } }
179 />
180 </BaseControl>
181
182 </PanelBody>
183
184 <PanelBody
185 title={ __( 'Minor Grid Lines' ) }
186 className="visualizer-inner-sections"
187 initialOpen={ false }
188 >
189
190 <TextControl
191 label={ __( 'Count' ) }
192 help={ __( 'The number of Vertical minor gridlines between two regular gridlines.' ) }
193 value={ settings.vAxis.minorGridlines.count }
194 onChange={ e => {
195 settings.vAxis.minorGridlines.count = e;
196 this.props.edit( settings );
197 } }
198 />
199
200 <BaseControl
201 label={ __( 'Color' ) }
202 >
203 <ColorPalette
204 value={ settings.vAxis.minorGridlines.color }
205 onChange={ e => {
206 settings.vAxis.minorGridlines.color = e;
207 this.props.edit( settings );
208 } }
209 />
210 </BaseControl>
211
212 </PanelBody>
213
214 <PanelBody
215 title={ __( 'View Window' ) }
216 className="visualizer-inner-sections"
217 initialOpen={ false }
218 >
219
220 <TextControl
221 label={ __( 'Maximun Value' ) }
222 help={ __( 'The maximum vertical data value to render.' ) }
223 value={ settings.vAxis.viewWindow.max }
224 onChange={ e => {
225 settings.vAxis.viewWindow.max = e;
226 this.props.edit( settings );
227 } }
228 />
229
230 <TextControl
231 label={ __( 'Minimum Value' ) }
232 help={ __( 'The minimum vertical data value to render.' ) }
233 value={ settings.vAxis.viewWindow.min }
234 onChange={ e => {
235 settings.vAxis.viewWindow.min = e;
236 this.props.edit( settings );
237 } }
238 />
239
240 </PanelBody>
241
242 </Fragment>
243
244 )}
245
246 </PanelBody>
247 );
248 }
249 }
250
251 export default VerticalAxisSettings;
252