| @@ -205,8 +205,9 @@ | ||
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | $source = new Visualizer_Source_Csv( VISUALIZER_ABSPATH . DIRECTORY_SEPARATOR . 'samples' . DIRECTORY_SEPARATOR . $chart_type . '.csv' ); |
| 208 | 208 | $source->fetch(); |
| 209 | + $series = $source->getSeries(); | |
| 209 | 210 | $response = array( |
| 210 | 211 | 'success' => 2, |
| 211 | 212 | 'message' => __( 'Something went wrong while importing the chart', 'visualizer' ), |
| 212 | 213 | ); |
| @@ -227,15 +228,113 @@ | ||
| 227 | 228 | |
| 228 | 229 | update_post_meta( $chart_id, Visualizer_Plugin::CF_CHART_TYPE, $chart_type ); |
| 229 | 230 | update_post_meta( $chart_id, Visualizer_Plugin::CF_DEFAULT_DATA, 1 ); |
| 230 | 231 | 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 ); | |
| 232 | 233 | 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 | + } | |
| 233 | 247 | update_post_meta( |
| 234 | 248 | $chart_id, |
| 235 | 249 | Visualizer_Plugin::CF_SETTINGS, |
| 236 | 250 | 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 | + ), | |
| 238 | 337 | ) |
| 239 | 338 | ); |
| 240 | 339 | $wizard_data = array( |
| 241 | 340 | 'chart_type' => $chart_type, |