Example #1
0
 /**
  * configures instance upon construct
  * @param \Altamira\JsWriter\JsWriterAbstract $jsWriter
  */
 protected function configure(\Altamira\JsWriter\JsWriterAbstract $jsWriter)
 {
     $confInstance = \Altamira\Config::getInstance();
     $file = $confInstance['altamira.root'] . $confInstance['altamira.typeconfigpath'];
     $config = \parse_ini_file($file, true);
     $libConfig = $config[strtolower($jsWriter->getLibrary())];
     $type = static::TYPE;
     $typeAttributes = preg_grep("/{$type}\\./i", array_keys($libConfig));
     foreach ($typeAttributes as $key) {
         $attribute = preg_replace("/{$type}\\./i", '', $key);
         $this->{$attribute} = $libConfig[$key];
     }
 }
Example #2
0
 /**
  * Returns the library key for the jswriter
  * @return string
  */
 public function getLibrary()
 {
     return $this->jsWriter->getLibrary();
 }
Example #3
0
 /**
  * Registers a series, performing some additional logic
  * @see \Altamira\JsWriter\JsWriterAbstract::initializeSeries()
  * @param \Altamira\Series|string $series
  * @return \Altamira\JsWriter\Flot
  */
 public function initializeSeries($series)
 {
     parent::initializeSeries($series);
     $title = $this->getSeriesTitle($series);
     $this->options['seriesStorage'][$title]['label'] = $title;
     return $this;
 }
Example #4
0
 /**
  * Registers a type for a series or entire chart
  * @see \Altamira\JsWriter\JsWriterAbstract::setType()
  * @param string|Altamira\Type\TypeAbstract $type
  * @param array $options
  * @param string $series
  * @return \Altamira\JsWriter\JqPlot
  */
 public function setType($type, $options = array(), $series = 'default')
 {
     parent::setType($type, $options, $series);
     if ($series == 'default') {
         $rendererOptions = $this->types['default']->getRendererOptions();
         if ($renderer = $this->types['default']->getRenderer()) {
             $this->options['seriesDefaults']['renderer'] = $renderer;
         }
         if (!empty($rendererOptions)) {
             $this->options['seriesDefaults']['rendererOptions'] = $rendererOptions;
         }
     }
     return $this;
 }
Example #5
0
 /**
  * Sets the rendering type for this series
  * @param string $type
  * @return \Altamira\Series provides fluent interface
  */
 public function setType($type)
 {
     $this->jsWriter->setType($type, $this->getTitle());
     return $this;
 }