src/UI/HTML/Indicator.php
public function build( $found, $count, $length = NULL )
	{
		$length			= is_null( $length ) ? $this->getOption( 'length' ) : $length;
		$found			= min( $found, $count );
		$ratio			= $count ? $found / $count : 0;
		$divBar			= $this->renderBar( $ratio, $length );
		$divRatio		= $this->renderRatio( $found, $count );
		$divPercentage	= $this->renderPercentage( $ratio );
		$divIndicator	= new UI_HTML_Tag( "div" );
		$divIndicator->setContent( $divBar.$divPercentage.$divRatio );
		$divIndicator->setAttribute( 'class', $this->getOption( 'classIndicator' ) );
		if( $this->getOption( 'id' ) )
			$divIndicator->setAttribute( 'id', $this->getOption( 'id' ) );
		if( $this->getOption( 'useData' ) ){
			$divIndicator->setAttribute( 'data-total', $count );
			$divIndicator->setAttribute( 'data-value', $found );
			foreach( $this->getOptions() as $key => $value )
//				if( strlen( $value ) )
//				if( preg_match( "/^use/", $key ) )
					$divIndicator->setAttribute( 'data-option-'.$key, (string) $value );
		}
		if( $this->getOption( 'useColorAtBorder' ) ){
			$color	= $this->getColorFromRatio( $ratio );
			$divIndicator->setAttribute( 'style', "border-color: rgb(".$color[0].",".$color[1].",".$color[2].")" );
		}
		return $divIndicator->build();
	}
public function build( $found, $count, $length = NULL )
	{
		$length			= is_null( $length ) ? $this->getOption( 'length' ) : $length;
		$found			= min( $found, $count );
		$ratio			= $count ? $found / $count : 0;
		$divBar			= $this->renderBar( $ratio, $length );
		$divRatio		= $this->renderRatio( $found, $count );
		$divPercentage	= $this->renderPercentage( $ratio );
		$divIndicator	= new UI_HTML_Tag( "div" );
		$divIndicator->setContent( $divBar.$divPercentage.$divRatio );
		$divIndicator->setAttribute( 'class', $this->getOption( 'classIndicator' ) );
		if( $this->getOption( 'id' ) )
			$divIndicator->setAttribute( 'id', $this->getOption( 'id' ) );
		if( $this->getOption( 'useData' ) ){
			$divIndicator->setAttribute( 'data-total', $count );
			$divIndicator->setAttribute( 'data-value', $found );
			foreach( $this->getOptions() as $key => $value )
//				if( strlen( $value ) )
//				if( preg_match( "/^use/", $key ) )
					$divIndicator->setAttribute( 'data-option-'.$key, (string) $value );
		}
		if( $this->getOption( 'useColorAtBorder' ) ){
			$color	= $this->getColorFromRatio( $ratio );
			$divIndicator->setAttribute( 'style', "border-color: rgb(".$color[0].",".$color[1].",".$color[2].")" );
		}
		return $divIndicator->build();
	}
public function build ( $ found , $ count , $ length = NULL ) { $ length = is_null ( $ length ) ? $ this -> getOption ( 'length' ) : $ length ; $ found = min ( $ found , $ count ) ; $ ratio = $ count ? $ found / $ count : 0 ; $ divBar = $ this -> renderBar ( $ ratio , $ length ) ; $ divRatio = $ this -> renderRatio ( $ found , $ count ) ; $ divPercentage = $ this -> renderPercentage ( $ ratio ) ; $ divIndicator = new UI_HTML_Tag ( "div" ) ; $ divIndicator -> setContent ( $ divBar . $ divPercentage . $ divRatio ) ; $ divIndicator -> setAttribute ( 'class' , $ this -> getOption ( 'classIndicator' ) ) ; if ( $ this -> getOption ( 'id' ) ) $ divIndicator -> setAttribute ( 'id' , $ this -> getOption ( 'id' ) ) ; if ( $ this -> getOption ( 'useData' ) ) { $ divIndicator -> setAttribute ( 'data-total' , $ count ) ; $ divIndicator -> setAttribute ( 'data-value' , $ found ) ; foreach ( $ this -> getOptions ( ) as $ key => $ value ) //				if( strlen( $value ) )
 //				if( preg_match( "/^use/", $key ) )
 $ divIndicator -> setAttribute ( 'data-option-' . $ key , ( string ) $ value ) ; } if ( $ this -> getOption ( 'useColorAtBorder' ) ) { $ color = $ this -> getColorFromRatio ( $ ratio ) ; $ divIndicator -> setAttribute ( 'style' , "border-color: rgb(" . $ color [ 0 ] . "," . $ color [ 1 ] . "," . $ color [ 2 ] . ")" ) ; } return $ divIndicator -> build ( ) ; }
Builds HTML of Indicator.
@access		public
@param		int			$found		Amount of positive Cases
@param		int			$count		Amount of all Cases
@param		int			$length		Length of inner Indicator Bar
@return		string
Builds HTML of Indicator .