Esempio n. 1
0
 /**
  * This is an alias for FlashChart::chart('bar_scetch',$options);
  *
  * Unfortunatly the Sketch class takes in is options as constructor
  * values instead of using the set methods like the other classes. 
  * 
  * @param array $options
  * 		valid option keys : colour, outline_colour, fun_factor
  * @param string $datasetName The name to be used to associate charts with data
  * @param string $chartId Name of chart. Use for seperate charts.
  * @return string
  */
 public function sketch($options = array(), $datasetName = 'default', $chartId = 'default')
 {
     if (empty($this->data[$datasetName])) {
         return false;
     }
     $this->Chart->set_bg_colour($this->bg_colour);
     $element = new bar_sketch($options['colour'], $options['outline_colour'], $options['fun_factor']);
     if (!empty($this->tooltip)) {
         $element->set_tooltip($this->tooltip);
     }
     $numbers = $this->getNumbers($datasetName);
     $element->set_values($numbers);
     $this->Chart->add_element($element);
     return $this->renderData($chartId);
 }
 /**
  * Method to render a sketchbar chart type
  * @param array $dataSet Data Set Info 
  */
 private function _renderSketchBarData($dataSet)
 {
     $bar = new bar_sketch($dataSet['width'], 7, $dataSet['color'], $dataSet['outlinecolor']);
     if ($dataSet['legend'] != NULL) {
         $bar->key($dataSet['legend'], 10);
     }
     $bar->data = $dataSet['data'];
     return $bar;
 }