| @@ -211,15 +211,14 @@ | ||
| 211 | 211 | 'success' => 2, |
| 212 | 212 | 'message' => __( 'Something went wrong while importing the chart', 'visualizer' ), |
| 213 | 213 | ); |
| 214 | 214 | |
| 215 | - $data = $source->getData(); | |
| 216 | 215 | $args = array( |
| 217 | 216 | 'post_type' => Visualizer_Plugin::CPT_VISUALIZER, |
| 218 | 217 | 'post_title' => 'Visualization', |
| 219 | 218 | 'post_author' => get_current_user_id(), |
| 220 | 219 | 'post_status' => 'publish', |
| 221 | - 'post_content' => $data, | |
| 220 | + 'post_content' => $source->getData(), | |
| 222 | 221 | ); |
| 223 | 222 | $chart_id = wp_insert_post( $args ); |
| 224 | 223 | |
| 225 | 224 | if ( $chart_id && ! is_wp_error( $chart_id ) ) { |
| @@ -232,12 +231,10 @@ | ||
| 232 | 231 | update_post_meta( $chart_id, Visualizer_Plugin::CF_SOURCE, $source->getSourceName() ); |
| 233 | 232 | update_post_meta( $chart_id, Visualizer_Plugin::CF_SERIES, $series ); |
| 234 | 233 | update_post_meta( $chart_id, Visualizer_Plugin::CF_CHART_LIBRARY, '' ); |
| 235 | 234 | |
| 236 | - $data = maybe_unserialize( $data ); | |
| 237 | 235 | $setting_series = array(); |
| 238 | - $setting_slices = array(); | |
| 239 | - foreach ( $data as $s ) { | |
| 236 | + foreach ( $series as $s ) { | |
| 240 | 237 | $setting_series[] = array( |
| 241 | 238 | 'visibleInLegend' => '', |
| 242 | 239 | 'lineWidth' => '', |
| 243 | 240 | 'pointSize' => '', |
| @@ -245,12 +242,8 @@ | ||
| 245 | 242 | 'curveType' => '', |
| 246 | 243 | 'color' => '', |
| 247 | 244 | 'role' => '', |
| 248 | 245 | ); |
| 249 | - $setting_slices[] = array( | |
| 250 | - 'offset' => 0, | |
| 251 | - 'color' => '', | |
| 252 | - ); | |
| 253 | 246 | } |
| 254 | 247 | update_post_meta( |
| 255 | 248 | $chart_id, |
| 256 | 249 | Visualizer_Plugin::CF_SETTINGS, |
| @@ -295,9 +288,9 @@ | ||
| 295 | 288 | 'height' => '', |
| 296 | 289 | ), |
| 297 | 290 | 'focusTarget' => 'datum', |
| 298 | 291 | 'series' => $setting_series, |
| 299 | - 'slices' => $setting_slices, | |
| 292 | + 'slices' => array(), | |
| 300 | 293 | 'vAxis' => array( |
| 301 | 294 | 'title' => '', |
| 302 | 295 | 'textPosition' => '', |
| 303 | 296 | 'direction' => 1, |
| @@ -338,45 +331,8 @@ | ||
| 338 | 331 | ), |
| 339 | 332 | 'viewWindow' => array( |
| 340 | 333 | 'max' => '', |
| 341 | 334 | 'min' => '', |
| 342 | - ), | |
| 343 | - ), | |
| 344 | - 'customcss' => array( | |
| 345 | - 'headerRow' => array( | |
| 346 | - 'background-color' => '', | |
| 347 | - 'color' => '', | |
| 348 | - 'transform' => '', | |
| 349 | - ), | |
| 350 | - 'tableRow' => array( | |
| 351 | - 'background-color' => '', | |
| 352 | - 'color' => '', | |
| 353 | - 'transform' => '', | |
| 354 | - ), | |
| 355 | - 'oddTableRow' => array( | |
| 356 | - 'background-color' => '', | |
| 357 | - 'color' => '', | |
| 358 | - 'transform' => '', | |
| 359 | - ), | |
| 360 | - 'selectedTableRow' => array( | |
| 361 | - 'background-color' => '', | |
| 362 | - 'color' => '', | |
| 363 | - 'transform' => '', | |
| 364 | - ), | |
| 365 | - 'hoverTableRow' => array( | |
| 366 | - 'background-color' => '', | |
| 367 | - 'color' => '', | |
| 368 | - 'transform' => '', | |
| 369 | - ), | |
| 370 | - 'headerCell' => array( | |
| 371 | - 'background-color' => '', | |
| 372 | - 'color' => '', | |
| 373 | - 'transform' => '', | |
| 374 | - ), | |
| 375 | - 'tableCell' => array( | |
| 376 | - 'background-color' => '', | |
| 377 | - 'color' => '', | |
| 378 | - 'transform' => '', | |
| 379 | 335 | ), |
| 380 | 336 | ), |
| 381 | 337 | ) |
| 382 | 338 | ); |