Skip to content

Commit

Permalink
Merge pull request #2 from ccoley/master
Browse files Browse the repository at this point in the history
Fix to allow proper autoloading
  • Loading branch information
jbogartPint authored Jul 5, 2016
2 parents ffbea01 + 6314733 commit a9b4181
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/zc.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php

namespace ZingChart\PHPWrapper;

class ZC {
private $mysqli;

Expand All @@ -13,12 +16,12 @@ class ZC {
private $fieldNames = array();
private $xAxisTitle = "";

public function __construct($id, $cType, $theme, $width, $height) {
public function __construct($id, $cType = 'area', $theme = 'light', $width = '100%', $height = '400') {
$this->chartId = $id;
$this->chartType = is_null($cType) ? 'area' : $cType;
$this->theme = is_null($theme) ? 'light' : $theme;
$this->width = is_null($width) ? '100%' : $width;
$this->height = is_null($height) ? '400' : $height;
$this->chartType = $cType;
$this->theme = $theme;
$this->width = $width;
$this->height = $height;

// Setting the chart type, this is not a top level function like width, height, theme, and id
$this->config['type'] = $this->chartType;
Expand Down Expand Up @@ -390,4 +393,4 @@ private function buildArray($propertyChain, $value) {
return array($key => $this->buildArray($propertyChain, $value));
}
}
?>
?>

0 comments on commit a9b4181

Please sign in to comment.