← All changes
|
classes/Visualizer/Gutenberg/src/Components/ChartSelect.js
+4
-3
3.10.2
→
3.10.8
View file →
| @@ -22,9 +22,9 @@ | ||
| 22 | 22 | import PanelButton from './PanelButton.js'; |
| 23 | 23 | |
| 24 | 24 | import merge from 'merge'; |
| 25 | 25 | |
| 26 | -import { compact, formatDate, isValidJSON, formatData } from '../utils.js'; | |
| 26 | +import { compact, formatDate, isValidJSON, formatData, googleChartPackages } from '../utils.js'; | |
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * WordPress dependencies |
| 30 | 30 | */ |
| @@ -55,11 +55,10 @@ | ||
| 55 | 55 | }; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | render() { |
| 59 | + let chartVersion = 'undefined' !== typeof google.visualization ? google.visualization.Version : 'current'; | |
| 59 | 60 | |
| 60 | - let chartVersion = 'undefined' !== typeof google ? google.visualization.Version : 'current'; | |
| 61 | - | |
| 62 | 61 | let chart, footer; |
| 63 | 62 | |
| 64 | 63 | let data = formatDate( JSON.parse( JSON.stringify( this.props.chart ) ) ); |
| 65 | 64 | |
| @@ -172,8 +171,9 @@ | ||
| 172 | 171 | compact( this.props.chart['visualizer-settings']) |
| 173 | 172 | } |
| 174 | 173 | height="500px" |
| 175 | 174 | formatters={ formatData( data ) } |
| 175 | + chartPackages={ googleChartPackages } | |
| 176 | 176 | /> |
| 177 | 177 | ) : ( |
| 178 | 178 | <Chart |
| 179 | 179 | chartVersion={ chartVersion } |
| @@ -186,8 +186,9 @@ | ||
| 186 | 186 | compact( this.props.chart['visualizer-settings']) |
| 187 | 187 | } |
| 188 | 188 | height="500px" |
| 189 | 189 | formatters={ formatData( data ) } |
| 190 | + chartPackages={ googleChartPackages } | |
| 190 | 191 | /> |
| 191 | 192 | ) |
| 192 | 193 | ) } |
| 193 | 194 | |