protected function onInit()
    {
        $this->useDataSource();
        $this->useAutoName("gchart");

        $this->clientEvents = Utility::get($this->params, "clientEvents", array());
        $this->columns = Utility::get($this->params, "columns", null);
        $this->options = Utility::get($this->params, "options", array());
        $this->width = Utility::get($this->params, "width", "100%");
        $this->height = Utility::get($this->params, "height", "400px");
        $this->title = Utility::get($this->params, "title");
        $this->pointerOnHover = Utility::get($this->params, "pointerOnHover");
        $this->mapsApiKey = Utility::get($this->params, "mapsApiKey", '');

        if (!$this->dataStore) {
            //Backward compatible with setting through "data"
            $data = Utility::get($this->params, "data");
            if (is_array($data)) {
                if (count($data) > 0) {
                    $this->dataStore = new DataStore;
                    $this->dataStore->data($data);
                    $row = $data[0];
                    $meta = array("columns" => array());
                    foreach ($row as $cKey => $cValue) {
                        $meta["columns"][$cKey] = array(
                            "type" => Utility::guessType($cValue),
                        );
                    }
                    $this->dataStore->meta($meta);
                } else {
                    $this->dataStore = new DataStore;
                    $this->dataStore->data(array());
                    $this->dataStore->meta(array("columns" => array()));
                }
            }
            if ($this->dataStore == null) {
                throw new \Exception("dataSource is required");
                return;
            }
        }

        $this->type = Utility::getClassName($this);
        if ($this->type == "Chart") {
            $this->type = Utility::get($this->params, "type");
        }
        //Color Scheme
        $this->colorScheme = Utility::get($this->params, "colorScheme");
        if (!is_array($this->colorScheme)) {
            $theme = $this->getReport()->getTheme();
            if ($theme) {
                $theme->applyColorScheme($this->colorScheme);
            }
        }
        if (!is_array($this->colorScheme)) {
            $this->colorScheme = null;
        }
    }