src/UI/HTML/Indicator.php
protected function renderBar( $ratio, $length = 100 )
	{
		$css			= array();
//		$width			= floor( $ratio * $length );
		$width			= max( 0, min( 100, $ratio * 100 ) );
		$css['width']	= $width.'%';
		if( $this->getOption( 'useColor' ) )
		{
			$color	= $this->getColorFromRatio( $ratio );
			$css['background-color']	= "rgb(".$color[0].",".$color[1].",".$color[2].")";
		}

		$attributes	= array(
			'class'	=> $this->getOption( 'classInner' ),
			'style'	=> $css,
		);
		$bar		= UI_HTML_Tag::create( 'div', "", $attributes );

		$attributes	= array( 'class' => $this->getOption( 'classOuter' ) );
		$css		= array();
		if( $length !== 100 )
			$css['width']	= preg_match( "/%$/", $length ) ? $length : $length.'px';
		if( $this->getOption( 'useColor' ) && $this->getOption( 'useColorAtBorder' ) )
			$css['border-color']	= "rgb(".$color[0].",".$color[1].",".$color[2].")";
		$attributes['style']	= $css;
		return UI_HTML_Tag::create( "span", $bar, $attributes );
	}
protected function renderBar( $ratio, $length = 100 )
	{
		$css			= array();
//		$width			= floor( $ratio * $length );
		$width			= max( 0, min( 100, $ratio * 100 ) );
		$css['width']	= $width.'%';
		if( $this->getOption( 'useColor' ) )
		{
			$color	= $this->getColorFromRatio( $ratio );
			$css['background-color']	= "rgb(".$color[0].",".$color[1].",".$color[2].")";
		}

		$attributes	= array(
			'class'	=> $this->getOption( 'classInner' ),
			'style'	=> $css,
		);
		$bar		= UI_HTML_Tag::create( 'div', "", $attributes );

		$attributes	= array( 'class' => $this->getOption( 'classOuter' ) );
		$css		= array();
		if( $length !== 100 )
			$css['width']	= preg_match( "/%$/", $length ) ? $length : $length.'px';
		if( $this->getOption( 'useColor' ) && $this->getOption( 'useColorAtBorder' ) )
			$css['border-color']	= "rgb(".$color[0].",".$color[1].",".$color[2].")";
		$attributes['style']	= $css;
		return UI_HTML_Tag::create( "span", $bar, $attributes );
	}
protected function renderBar ( $ ratio , $ length = 100 ) { $ css = array ( ) ; //		$width			= floor( $ratio * $length );
 $ width = max ( 0 , min ( 100 , $ ratio * 100 ) ) ; $ css [ 'width' ] = $ width . '%' ; if ( $ this -> getOption ( 'useColor' ) ) { $ color = $ this -> getColorFromRatio ( $ ratio ) ; $ css [ 'background-color' ] = "rgb(" . $ color [ 0 ] . "," . $ color [ 1 ] . "," . $ color [ 2 ] . ")" ; } $ attributes = array ( 'class' => $ this -> getOption ( 'classInner' ) , 'style' => $ css , ) ; $ bar = UI_HTML_Tag :: create ( 'div' , "" , $ attributes ) ; $ attributes = array ( 'class' => $ this -> getOption ( 'classOuter' ) ) ; $ css = array ( ) ; if ( $ length !== 100 ) $ css [ 'width' ] = preg_match ( "/%$/" , $ length ) ? $ length : $ length . 'px' ; if ( $ this -> getOption ( 'useColor' ) && $ this -> getOption ( 'useColorAtBorder' ) ) $ css [ 'border-color' ] = "rgb(" . $ color [ 0 ] . "," . $ color [ 1 ] . "," . $ color [ 2 ] . ")" ; $ attributes [ 'style' ] = $ css ; return UI_HTML_Tag :: create ( "span" , $ bar , $ attributes ) ; }
Builds HTML Code of Indicator Bar.
@access		protected
@param		float		$ratio		Ratio (between 0 and 1)
@param		int			$length		Length of Indicator
@return		string
Builds HTML Code of Indicator Bar .