Skip to content

Commit 3e5d745

Browse files
Merge pull request #1011 from Codeinwp/bugfix/1010
Fixed Gutenberg block error
2 parents 757e7e8 + 0bc6b2d commit 3e5d745

File tree

1 file changed

+101
-2
lines changed

1 file changed

+101
-2
lines changed

classes/Visualizer/Module/Wizard.php

Lines changed: 101 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ private function setup_wizard_import_chart() {
206206

207207
$source = new Visualizer_Source_Csv( VISUALIZER_ABSPATH . DIRECTORY_SEPARATOR . 'samples' . DIRECTORY_SEPARATOR . $chart_type . '.csv' );
208208
$source->fetch();
209+
$series = $source->getSeries();
209210
$response = array(
210211
'success' => 2,
211212
'message' => __( 'Something went wrong while importing the chart', 'visualizer' ),
@@ -228,13 +229,111 @@ private function setup_wizard_import_chart() {
228229
update_post_meta( $chart_id, Visualizer_Plugin::CF_CHART_TYPE, $chart_type );
229230
update_post_meta( $chart_id, Visualizer_Plugin::CF_DEFAULT_DATA, 1 );
230231
update_post_meta( $chart_id, Visualizer_Plugin::CF_SOURCE, $source->getSourceName() );
231-
update_post_meta( $chart_id, Visualizer_Plugin::CF_SERIES, $source->getSeries() );
232+
update_post_meta( $chart_id, Visualizer_Plugin::CF_SERIES, $series );
232233
update_post_meta( $chart_id, Visualizer_Plugin::CF_CHART_LIBRARY, '' );
234+
235+
$setting_series = array();
236+
foreach ( $series as $s ) {
237+
$setting_series[] = array(
238+
'visibleInLegend' => '',
239+
'lineWidth' => '',
240+
'pointSize' => '',
241+
'format' => '',
242+
'curveType' => '',
243+
'color' => '',
244+
'role' => '',
245+
);
246+
}
233247
update_post_meta(
234248
$chart_id,
235249
Visualizer_Plugin::CF_SETTINGS,
236250
array(
237-
'focusTarget' => 'datum',
251+
'title' => '',
252+
'titlePosition' => '',
253+
'titleTextStyle' => array(
254+
'color' => '#000',
255+
),
256+
'legend' => array(
257+
'position' => 'right',
258+
'alignment' => 15,
259+
'textStyle' => array(
260+
'color' => '#000',
261+
'text' => 'both',
262+
),
263+
),
264+
'tooltip' => array(
265+
'trigger' => 'focus',
266+
'showColorCode' => 0,
267+
'showColorCode' => 0,
268+
),
269+
'animation' => array(
270+
'startup' => 0,
271+
'duration' => '',
272+
'easing' => 'linear',
273+
),
274+
'width' => '',
275+
'height' => '',
276+
'keepAspectRatio' => false,
277+
'isStacked' => false,
278+
'lazy_load_chart' => true,
279+
'backgroundColor' => array(
280+
'strokeWidth' => '',
281+
'stroke' => '',
282+
'fill' => '',
283+
),
284+
'chartArea' => array(
285+
'left' => '',
286+
'top' => '',
287+
'width' => '',
288+
'height' => '',
289+
),
290+
'focusTarget' => 'datum',
291+
'series' => $setting_series,
292+
'slices' => array(),
293+
'vAxis' => array(
294+
'title' => '',
295+
'textPosition' => '',
296+
'direction' => 1,
297+
'baselineColor' => '#000',
298+
'textStyle' => array(
299+
'color' => '#000',
300+
),
301+
'format' => '',
302+
'gridlines' => array(
303+
'count' => '',
304+
'color' => '#ccc',
305+
),
306+
'minorGridlines' => array(
307+
'count' => '',
308+
'color' => '',
309+
),
310+
'viewWindow' => array(
311+
'max' => '',
312+
'min' => '',
313+
),
314+
),
315+
'hAxis' => array(
316+
'title' => '',
317+
'textPosition' => '',
318+
'direction' => 1,
319+
'baselineColor' => '#000',
320+
'textStyle' => array(
321+
'color' => '#000',
322+
),
323+
'format' => '',
324+
'gridlines' => array(
325+
'count' => '',
326+
'color' => '#ccc',
327+
),
328+
'minorGridlines' => array(
329+
'count' => '',
330+
'color' => '',
331+
),
332+
'viewWindow' => array(
333+
'max' => '',
334+
'min' => '',
335+
),
336+
),
238337
)
239338
);
240339
$wizard_data = array(

0 commit comments

Comments
 (0)