Skip to content

Commit 668c9de

Browse files
author
Eugene Manuilov
committed
Implemented data opacity and interpolate nulls settings for line chart
1 parent 7f7b823 commit 668c9de

File tree

4 files changed

+40
-18
lines changed

4 files changed

+40
-18
lines changed

classes/Visualizer/Render/Sidebar/Linear.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,16 @@ protected function _renderLineSettingsItems() {
220220
),
221221
esc_html__( 'Determines how multiple data selections are rolled up into tooltips. To make it working you need to set multiple selection mode and tooltip trigger to display it when an user selects an element.', Visualizer_Plugin::NAME )
222222
);
223+
224+
echo '<div class="section-delimiter"></div>';
225+
226+
self::_renderTextItem(
227+
esc_html__( 'Point Opacity', Visualizer_Plugin::NAME ),
228+
'dataOpacity',
229+
$this->dataOpacity,
230+
esc_html__( 'The transparency of data points, with 1.0 being completely opaque and 0.0 fully transparent.', Visualizer_Plugin::NAME ),
231+
'1.0'
232+
);
223233
}
224234

225235
/**

classes/Visualizer/Render/Sidebar/Type/Area.php

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ protected function _toHTML() {
7070
protected function _renderLineSettingsItems() {
7171
parent::_renderLineSettingsItems();
7272

73+
self::_renderTextItem(
74+
esc_html__( 'Area Opacity', Visualizer_Plugin::NAME ),
75+
'areaOpacity',
76+
$this->areaOpacity,
77+
esc_html__( 'The default opacity of the colored area under an area chart series, where 0.0 is fully transparent and 1.0 is fully opaque. To specify opacity for an individual series, set the area opacity value in the series property.', Visualizer_Plugin::NAME ),
78+
'0.3'
79+
);
80+
7381
echo '<div class="section-delimiter"></div>';
7482

7583
self::_renderSelectItem(
@@ -79,24 +87,6 @@ protected function _renderLineSettingsItems() {
7987
$this->_yesno,
8088
esc_html__( 'If set to yes, series elements are stacked.', Visualizer_Plugin::NAME )
8189
);
82-
83-
echo '<div class="section-delimiter"></div>';
84-
85-
self::_renderTextItem(
86-
esc_html__( 'Point Opacity', Visualizer_Plugin::NAME ),
87-
'dataOpacity',
88-
$this->dataOpacity,
89-
esc_html__( 'The transparency of data points, with 1.0 being completely opaque and 0.0 fully transparent.', Visualizer_Plugin::NAME ),
90-
'1.0'
91-
);
92-
93-
self::_renderTextItem(
94-
esc_html__( 'Area Opacity', Visualizer_Plugin::NAME ),
95-
'areaOpacity',
96-
$this->areaOpacity,
97-
esc_html__( 'The default opacity of the colored area under an area chart series, where 0.0 is fully transparent and 1.0 is fully opaque. To specify opacity for an individual series, set the area opacity value in the series property.', Visualizer_Plugin::NAME ),
98-
'0.3'
99-
);
10090
}
10191

10292
/**

classes/Visualizer/Render/Sidebar/Type/Line.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,25 @@ protected function _toHTML() {
4747
$this->_renderViewSettings();
4848
}
4949

50+
/**
51+
* Renders line settings items.
52+
*
53+
* @since 1.4.0
54+
*
55+
* @access protected
56+
*/
57+
protected function _renderLineSettingsItems() {
58+
parent::_renderLineSettingsItems();
59+
60+
echo '<div class="section-delimiter"></div>';
61+
62+
self::_renderSelectItem(
63+
esc_html__( 'Interpolate Nulls', Visualizer_Plugin::NAME ),
64+
'interpolateNulls',
65+
$this->interpolateNulls,
66+
$this->_yesno,
67+
esc_html__( 'Whether to guess the value of missing points. If yes, it will guess the value of any missing data based on neighboring points. If no, it will leave a break in the line at the unknown point.', Visualizer_Plugin::NAME )
68+
);
69+
}
70+
5071
}

readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ Pay attention that to turn your shortcodes into graphs, your theme has to have `
5959
== Changelog ==
6060

6161
= 1.4 =
62+
* Implemented data opacity and interpolate nulls settings for line chart
6263
* Implemented ability to edit tooltip settings
6364
* Implemented new settings for linear charts like selection mode and aggregation target
6465
* Implemented area and point opacity settings for area chart

0 commit comments

Comments
 (0)