update(percent) {
		const self = this;
		let color = '';

		// set needle color according to kpi value
		if( (this._kpi / 100) >= percent) color = this._color[0];
		else color = this._color[1];
		this._el.select('.needle-center').style('fill', color);
		this._el.select('.needle').style('fill', color);
		this._el.select('.needle-text').text( Math.floor( percent * 100 ) + '%' );

		this._el.transition()
		.delay(this._animationDelay)
		.ease(this._easeType)
		.duration(this._animationDuration)
		.selectAll('.needle')
		.tween('progress', function () {
			const thisElement = this;
			const delta = percent - self._percent;
			const initialPercent = self._percent;
			return function (progressPercent) {
				self._percent = initialPercent + progressPercent * delta;
				return select(thisElement)
				.attr('d', self._getPath(self._percent));
			}
		});
	}
/**
	* Updates the needle position based on the percentage specified.
	*
	* @param percent The percentage to use.
	*/
Updates the needle position based on the percentage specified.
@param percent The percentage to use.
Updates the needle position based on the percentage specified . @param percent The percentage to use .
update(percent) {
		const self = this;
		let color = '';
		if( (this._kpi / 100) >= percent) color = this._color[0];
		else color = this._color[1];
		this._el.select('.needle-center').style('fill', color);
		this._el.select('.needle').style('fill', color);
		this._el.select('.needle-text').text( Math.floor( percent * 100 ) + '%' );
		this._el.transition()
		.delay(this._animationDelay)
		.ease(this._easeType)
		.duration(this._animationDuration)
		.selectAll('.needle')
		.tween('progress', function () {
			const thisElement = this;
			const delta = percent - self._percent;
			const initialPercent = self._percent;
			return function (progressPercent) {
				self._percent = initialPercent + progressPercent * delta;
				return select(thisElement)
				.attr('d', self._getPath(self._percent));
			}
		});
	}
update ( percent ) { const self = this ; let color = '' ; if ( ( this . _kpi / 100 ) >= percent ) color = this . _color [ 0 ] ; else color = this . _color [ 1 ] ; this . _el . select ( '.needle-center' ) . style ( 'fill' , color ) ; this . _el . select ( '.needle' ) . style ( 'fill' , color ) ; this . _el . select ( '.needle-text' ) . text ( Math . floor ( percent * 100 ) + '%' ) ; this . _el . transition ( ) . delay ( this . _animationDelay ) . ease ( this . _easeType ) . duration ( this . _animationDuration ) . selectAll ( '.needle' ) . tween ( 'progress' , function ( ) { const thisElement = this ; const delta = percent - self . _percent ; const initialPercent = self . _percent ; return function ( progressPercent ) { self . _percent = initialPercent + progressPercent * delta ; return select ( thisElement ) . attr ( 'd' , self . _getPath ( self . _percent ) ) ; } } ) ; }
Updates the needle position based on the percentage specified.
Updates the needle position based on the percentage specified .
// set needle color according to kpi value