protected function registerJs()
	{
		//prepare values
		$values = Json::encode($this->values);

		//prepare config
		$config = [
			'type'=>$this->type,
			'height'=>$this->height,
		];
		if ($this->type !== self::SPARKLINE_BAR) {
			$config['width'] = $this->width;
		}
		$config = Json::encode(ArrayHelper::merge($this->sparklineConfig, $config));

		//create and register js
		$js = sprintf("$('#%s').sparkline(%s, %s);", $this->id, $values, $config);
		$this->view->registerJs($js);
	}
protected function registerJs()
	{
		//prepare values
		$values = Json::encode($this->values);

		//prepare config
		$config = [
			'type'=>$this->type,
			'height'=>$this->height,
		];
		if ($this->type !== self::SPARKLINE_BAR) {
			$config['width'] = $this->width;
		}
		$config = Json::encode(ArrayHelper::merge($this->sparklineConfig, $config));

		//create and register js
		$js = sprintf("$('#%s').sparkline(%s, %s);", $this->id, $values, $config);
		$this->view->registerJs($js);
	}
protected function registerJs ( ) { //prepare values $ values = Json :: encode ( $ this -> values ) ; //prepare config $ config = [ 'type' => $ this -> type , 'height' => $ this -> height , ] ; if ( $ this -> type !== self :: SPARKLINE_BAR ) { $ config [ 'width' ] = $ this -> width ; } $ config = Json :: encode ( ArrayHelper :: merge ( $ this -> sparklineConfig , $ config ) ) ; //create and register js $ js = sprintf ( "$('#%s').sparkline(%s, %s);" , $ this -> id , $ values , $ config ) ; $ this -> view -> registerJs ( $ js ) ; }
Creates and registers the needed javascript code to run the widget
Creates and registers the needed javascript code to run the widget