File tree Expand file tree Collapse file tree 4 files changed +53
-1
lines changed Expand file tree Collapse file tree 4 files changed +53
-1
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ class Visualizer_Render_Sidebar_Type_Gauge extends Visualizer_Render_Sidebar {
39
39
*/
40
40
protected function _toHTML () {
41
41
$ this ->_supportsAnimation = false ;
42
+ $ this ->_renderGeneralSettings ();
42
43
$ this ->_renderGaugeSettings ();
43
44
$ this ->_renderViewSettings ();
44
45
$ this ->_renderAdvancedSettings ();
@@ -60,6 +61,21 @@ protected function _renderGaugeSettings() {
60
61
self ::_renderGroupEnd ();
61
62
}
62
63
64
+ protected function _renderGeneralSettings () {
65
+ self ::_renderGroupStart ( esc_html__ ( 'General Settings ' , 'visualizer ' ) );
66
+
67
+ self ::_renderSectionStart ( esc_html__ ( 'Title ' , 'visualizer ' ), false );
68
+ self ::_renderTextItem (
69
+ esc_html__ ( 'Chart Title ' , 'visualizer ' ),
70
+ 'title ' ,
71
+ $ this ->title ,
72
+ esc_html__ ( 'Text to display in the back-end admin area. ' , 'visualizer ' )
73
+ );
74
+ self ::_renderSectionEnd ();
75
+
76
+ self ::_renderSectionStart ( esc_html__ ( 'Gauge Settings ' , 'visualizer ' ), false );
77
+ }
78
+
63
79
/**
64
80
* Renders tick settings group.
65
81
*
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ class Visualizer_Render_Sidebar_Type_Geo extends Visualizer_Render_Sidebar {
39
39
*/
40
40
protected function _toHTML () {
41
41
$ this ->_supportsAnimation = false ;
42
+ $ this ->_renderGeneralSettings ();
42
43
$ this ->_renderMapSettings ();
43
44
$ this ->_renderColorAxisSettings ();
44
45
$ this ->_renderSizeAxisSettings ();
@@ -47,6 +48,26 @@ protected function _toHTML() {
47
48
$ this ->_renderAdvancedSettings ();
48
49
}
49
50
51
+ /**
52
+ * Renders general settings group.
53
+ *
54
+ * @since 1.0.0
55
+ *
56
+ * @access protected
57
+ */
58
+ protected function _renderGeneralSettings () {
59
+ self ::_renderGroupStart ( esc_html__ ( 'General Settings ' , 'visualizer ' ) );
60
+ self ::_renderSectionStart ( esc_html__ ( 'Title ' , 'visualizer ' ), false );
61
+ self ::_renderTextItem (
62
+ esc_html__ ( 'Chart Title ' , 'visualizer ' ),
63
+ 'title ' ,
64
+ $ this ->title ,
65
+ esc_html__ ( 'Text to display in the back-end admin area. ' , 'visualizer ' )
66
+ );
67
+ self ::_renderSectionEnd ();
68
+ self ::_renderGroupEnd ();
69
+ }
70
+
50
71
/**
51
72
* Renders map settings group.
52
73
*
Original file line number Diff line number Diff line change @@ -88,7 +88,9 @@ function visualizer_launch() {
88
88
if ( is_admin () || defined ( 'WP_TESTS_DOMAIN ' ) ) {
89
89
// set admin modules
90
90
$ plugin ->setModule ( Visualizer_Module_Admin::NAME );
91
- } else {
91
+ }
92
+
93
+ if ( ! is_admin () || defined ( 'WP_TESTS_DOMAIN ' ) ) {
92
94
// set frontend modules
93
95
$ plugin ->setModule ( Visualizer_Module_Frontend::NAME );
94
96
}
Original file line number Diff line number Diff line change 1
1
/* global google */
2
2
/* global visualizer */
3
3
/* global console */
4
+
5
+ // this will store the images for each chart rendered.
6
+ var __visualizer_chart_images = [ ] ;
7
+
4
8
( function ( v , g ) {
5
9
var gv ;
6
10
207
211
208
212
v . override ( settings ) ;
209
213
214
+ g . visualization . events . addListener ( render , 'ready' , function ( ) {
215
+ var arr = id . split ( '-' ) ;
216
+ try {
217
+ __visualizer_chart_images [ arr [ 0 ] + '-' + arr [ 1 ] ] = render . getImageURI ( ) ;
218
+ } catch ( error ) {
219
+ console . warn ( 'render.getImageURI not defined for ' + arr [ 0 ] + '-' + arr [ 1 ] ) ;
220
+ }
221
+ } ) ;
222
+
210
223
render . draw ( table , settings ) ;
211
224
} ;
212
225
You can’t perform that action at this time.
0 commit comments