@@ -3,8 +3,8 @@ import { View, Text } from 'react-native';
33import PropTypes from 'prop-types' ;
44import { getStyles } from './rules' ;
55
6- const Speedometer = ( { value, totalValue, size, outerColor, innerColor, internalColor, style, innerCircleStyle, outerCircleStyle, halfCircleStyle, showText, text, textStyle, showLabels, labelStyle, showPercent, percentStyle } ) => {
7- const styles = getStyles ( size ) ;
6+ const Speedometer = ( { value, totalValue, size, outerColor, innerColor, internalColor, style, innerCircleStyle, outerCircleStyle, halfCircleStyle, showText, text, textStyle, showLabels, labelStyle, showPercent, percentStyle, percentSize } ) => {
7+ const styles = getStyles ( size , percentSize ) ;
88 const degreesValue = ( value > totalValue ) ? totalValue : value ;
99 const percentValue = parseInt ( String ( ( value * 100 ) / totalValue ) . split ( '.' ) [ 0 ] ) ;
1010 const degrees = ( ( degreesValue * 180 ) / ( ( totalValue === 0 ) ? 1 : totalValue ) ) - 90 ;
@@ -60,9 +60,10 @@ Speedometer.propTypes = {
6060 labelStyle : PropTypes . object ,
6161 showPercent : PropTypes . bool ,
6262 percentStyle : PropTypes . object ,
63- innerCircleStyle : PropTypes . object ,
63+ innerCircleStyle : PropTypes . object ,
6464 outerCircleStyle : PropTypes . object ,
6565 halfCircleStyle : PropTypes . object ,
66+ percentSize : PropTypes . number ,
6667} ;
6768
6869Speedometer . defaultProps = {
@@ -78,6 +79,7 @@ Speedometer.defaultProps = {
7879 labelStyle : { } ,
7980 showPercent : false ,
8081 percentStyle : { } ,
82+ percentSize : 0.5 ,
8183} ;
8284
8385export default Speedometer ;
0 commit comments