← All changes
|
classes/Visualizer/Gutenberg/src/Components/ChartRender.js
+1
-14
3.10.13
→
3.4.8
View file →
| @@ -6,9 +6,9 @@ | ||
| 6 | 6 | import DataTable from './DataTable.js'; |
| 7 | 7 | |
| 8 | 8 | import merge from 'merge'; |
| 9 | 9 | |
| 10 | -import { compact, formatDate, isValidJSON, formatData, googleChartPackages } from '../utils.js'; | |
| 10 | +import { compact, formatDate, isValidJSON, formatData } from '../utils.js'; | |
| 11 | 11 | |
| 12 | 12 | /** |
| 13 | 13 | * WordPress dependencies |
| 14 | 14 | */ |
| @@ -35,11 +35,8 @@ | ||
| 35 | 35 | super( ...arguments ); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | render() { |
| 39 | - | |
| 40 | - let chartVersion = 'undefined' !== typeof google ? google.visualization.Version : 'current'; | |
| 41 | - | |
| 42 | 39 | let chart, footer; |
| 43 | 40 | |
| 44 | 41 | let data = formatDate( JSON.parse( JSON.stringify( this.props.chart ) ) ); |
| 45 | 42 | |
| @@ -60,14 +57,8 @@ | ||
| 60 | 57 | if ( data['visualizer-data-exploded']) { |
| 61 | 58 | footer = __( 'Annotations in this chart may not display here but they will display in the front end.' ); |
| 62 | 59 | } |
| 63 | 60 | |
| 64 | - if ( this.props.chart['visualizer-series'] && 0 <= [ 'date', 'datetime', 'timeofday' ].indexOf( this.props.chart['visualizer-series'][0].type ) ) { | |
| 65 | - if ( this.props.chart['visualizer-settings'] && ( this.props.chart['visualizer-settings'].hAxis && '' == this.props.chart['visualizer-settings'].hAxis.format ) ) { | |
| 66 | - this.props.chart['visualizer-settings'].hAxis.format = 'YYYY-MM-dd'; | |
| 67 | - } | |
| 68 | - } | |
| 69 | - | |
| 70 | 61 | return ( |
| 71 | 62 | <div className={ this.props.className }> |
| 72 | 63 | |
| 73 | 64 | { ( null !== this.props.chart ) && |
| @@ -96,9 +87,8 @@ | ||
| 96 | 87 | options={ data['visualizer-settings'] } |
| 97 | 88 | /> |
| 98 | 89 | ) : ( '' !== data['visualizer-data-exploded'] ? ( |
| 99 | 90 | <Chart |
| 100 | - chartVersion={ chartVersion } | |
| 101 | 91 | chartType={ chart } |
| 102 | 92 | rows={ data['visualizer-data'] } |
| 103 | 93 | columns={ data['visualizer-series'] } |
| 104 | 94 | options={ |
| @@ -107,13 +97,11 @@ | ||
| 107 | 97 | compact( this.props.chart['visualizer-settings']) |
| 108 | 98 | } |
| 109 | 99 | height="500px" |
| 110 | 100 | formatters={ formatData( data ) } |
| 111 | - chartPackages={ googleChartPackages } | |
| 112 | 101 | /> |
| 113 | 102 | ) : ( |
| 114 | 103 | <Chart |
| 115 | - chartVersion={ chartVersion } | |
| 116 | 104 | chartType={ chart } |
| 117 | 105 | rows={ data['visualizer-data'] } |
| 118 | 106 | columns={ data['visualizer-series'] } |
| 119 | 107 | options={ |
| @@ -122,9 +110,8 @@ | ||
| 122 | 110 | compact( this.props.chart['visualizer-settings']) |
| 123 | 111 | } |
| 124 | 112 | height="500px" |
| 125 | 113 | formatters={ formatData( data ) } |
| 126 | - chartPackages={ googleChartPackages } | |
| 127 | 114 | /> |
| 128 | 115 | ) ) } |
| 129 | 116 | |
| 130 | 117 | <div className="visualizer-settings__charts-footer"><sub> |