Skip to content

Commit 9785501

Browse files
Merge pull request #777 from contactashish13/issue-771
omit left in legend position for bubble chart
2 parents 70ec9f5 + 3e0c4c5 commit 9785501

File tree

7 files changed

+33
-6
lines changed

7 files changed

+33
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11

2+
### v3.4.8 - 2020-09-29
3+
**Changes:**
4+
* [Fix] Option to edit charts imported from JSON
5+
26
### v3.4.7 - 2020-09-21
37
**Changes:**
48
* - [Fix] Import from JSON: Reordering columns only reorders the label, not the associated data

classes/Visualizer/Gutenberg/build/block.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

classes/Visualizer/Gutenberg/src/Components/Sidebar/GeneralSettings.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ class GeneralSettings extends Component {
4646
positions.push({ label: __( 'Inside the chart' ), value: 'in' });
4747
}
4848

49+
if ( 'bubble' === type ) {
50+
positions = positions.filter( function( obj ) {
51+
return 'left' !== obj.value;
52+
});
53+
}
54+
4955
let titleHelp = __( 'Text to display above the chart.' );
5056
if ( 0 <= [ 'tabular', 'dataTable', 'gauge', 'geo', 'timeline' ].indexOf( type ) ) {
5157
titleHelp = __( 'Text to display in the back-end admin area' );
@@ -200,9 +206,11 @@ class GeneralSettings extends Component {
200206
if ( 'pie' !== type ) {
201207
let axis = 'left' === e ? 1 : 0;
202208

203-
Object.keys( settings.series ).map( i => {
204-
settings.series[i].targetAxisIndex = axis;
205-
});
209+
if ( settings.series ) {
210+
Object.keys( settings.series ).map( i => {
211+
settings.series[i].targetAxisIndex = axis;
212+
});
213+
}
206214
}
207215

208216
settings.legend.position = e;

classes/Visualizer/Render/Sidebar/Google.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,15 @@ public function __construct( $data = array() ) {
6767
'none' => esc_html__( 'Omit the legend', 'visualizer' ),
6868
);
6969

70-
if ( ! in_array( $this->get_chart_type( false ), array( 'Pie' ), true ) ) {
70+
$chart_type = $this->get_chart_type( false );
71+
if ( ! in_array( $chart_type, array( 'Pie' ), true ) ) {
7172
$this->_legendPositions['in'] = esc_html__( 'Inside the chart', 'visualizer' );
7273
}
7374

75+
if ( in_array( $chart_type, array( 'Bubble' ), true ) ) {
76+
unset( $this->_legendPositions['left'] );
77+
}
78+
7479
$this->_alignments = array(
7580
'' => '',
7681
'start' => esc_html__( 'Aligned to the start of the allocated area', 'visualizer' ),

readme.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ Pay attention that to turn your shortcodes into graphs, your theme has to have `
162162
13. Bar chart
163163

164164
## Changelog ##
165+
### 3.4.8 - 2020-09-29 ###
166+
167+
* [Fix] Option to edit charts imported from JSON
168+
169+
165170
### 3.4.7 - 2020-09-21 ###
166171

167172
* - [Fix] Import from JSON: Reordering columns only reorders the label, not the associated data

readme.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ Pay attention that to turn your shortcodes into graphs, your theme has to have `
162162
13. Bar chart
163163

164164
== Changelog ==
165+
= 3.4.8 - 2020-09-29 =
166+
167+
* [Fix] Option to edit charts imported from JSON
168+
169+
165170
= 3.4.7 - 2020-09-21 =
166171

167172
* - [Fix] Import from JSON: Reordering columns only reorders the label, not the associated data

themeisle-hash.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"index.php":"a50ed270dae4dd71bc1634ba32d8e897"}
1+
{"index.php":"e696714581e4570da2662a4e020bbbd8"}

0 commit comments

Comments
 (0)