| @@ -211,14 +211,15 @@ | ||
| 211 | 211 | 'success' => 2, |
| 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 | |
| 224 | 225 | if ( $chart_id && ! is_wp_error( $chart_id ) ) { |
| @@ -231,10 +232,12 @@ | ||
| 231 | 232 | update_post_meta( $chart_id, Visualizer_Plugin::CF_SOURCE, $source->getSourceName() ); |
| 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' => '', |
| 240 | 243 | 'pointSize' => '', |
| @@ -242,8 +245,12 @@ | ||
| 242 | 245 | 'curveType' => '', |
| 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, |
| 249 | 256 | Visualizer_Plugin::CF_SETTINGS, |
| @@ -288,9 +295,9 @@ | ||
| 288 | 295 | 'height' => '', |
| 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' => '', |
| 296 | 303 | 'direction' => 1, |
| @@ -331,8 +338,45 @@ | ||
| 331 | 338 | ), |
| 332 | 339 | 'viewWindow' => array( |
| 333 | 340 | 'max' => '', |
| 334 | 341 | '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' => '', | |
| 335 | 379 | ), |
| 336 | 380 | ), |
| 337 | 381 | ) |
| 338 | 382 | ); |