@@ -212,12 +212,13 @@ private function setup_wizard_import_chart() {
212
212
'message ' => __ ( 'Something went wrong while importing the chart ' , 'visualizer ' ),
213
213
);
214
214
215
+ $ data = $ source ->getData ();
215
216
$ args = array (
216
217
'post_type ' => Visualizer_Plugin::CPT_VISUALIZER ,
217
218
'post_title ' => 'Visualization ' ,
218
219
'post_author ' => get_current_user_id (),
219
220
'post_status ' => 'publish ' ,
220
- 'post_content ' => $ source -> getData () ,
221
+ 'post_content ' => $ data ,
221
222
);
222
223
$ chart_id = wp_insert_post ( $ args );
223
224
@@ -232,8 +233,10 @@ private function setup_wizard_import_chart() {
232
233
update_post_meta ( $ chart_id , Visualizer_Plugin::CF_SERIES , $ series );
233
234
update_post_meta ( $ chart_id , Visualizer_Plugin::CF_CHART_LIBRARY , '' );
234
235
236
+ $ data = maybe_unserialize ( $ data );
235
237
$ setting_series = array ();
236
- foreach ( $ series as $ s ) {
238
+ $ setting_slices = array ();
239
+ foreach ( $ data as $ s ) {
237
240
$ setting_series [] = array (
238
241
'visibleInLegend ' => '' ,
239
242
'lineWidth ' => '' ,
@@ -243,6 +246,10 @@ private function setup_wizard_import_chart() {
243
246
'color ' => '' ,
244
247
'role ' => '' ,
245
248
);
249
+ $ setting_slices [] = array (
250
+ 'offset ' => 0 ,
251
+ 'color ' => '' ,
252
+ );
246
253
}
247
254
update_post_meta (
248
255
$ chart_id ,
@@ -289,7 +296,7 @@ private function setup_wizard_import_chart() {
289
296
),
290
297
'focusTarget ' => 'datum ' ,
291
298
'series ' => $ setting_series ,
292
- 'slices ' => array () ,
299
+ 'slices ' => $ setting_slices ,
293
300
'vAxis ' => array (
294
301
'title ' => '' ,
295
302
'textPosition ' => '' ,
0 commit comments