Skip to content

Commit f878a53

Browse files
Merge branch 'Emad-salah-patch-1'
2 parents 713a0d8 + 887c219 commit f878a53

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ yarn add react-native-speedometer-chart
3030
| labelStyle | {} | object | no | Label style |
3131
| showPercent | false | bool | no | Show center percent |
3232
| percentStyle | {} | object | no | Percent style |
33+
| innerCircleStyle | null | object | no | |
34+
| outerCircleStyle | null | object | no | |
35+
| halfCircleStyle | null | object | no | |
3336

3437

3538
## Basic Usage

src/index.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { View, Text } from 'react-native';
33
import PropTypes from 'prop-types';
44
import { getStyles } from './rules';
55

6-
const Speedometer = ({ value, totalValue, size, outerColor, innerColor, internalColor, style, showText, text, textStyle, showLabels, labelStyle, showPercent, percentStyle }) => {
6+
const Speedometer = ({ value, totalValue, size, outerColor, innerColor, internalColor, style, innerCircleStyle, outerCircleStyle, halfCircleStyle, showText, text, textStyle, showLabels, labelStyle, showPercent, percentStyle }) => {
77
const styles = getStyles(size);
88
const degreesValue = (value > totalValue) ? totalValue : value;
99
const percentValue = parseInt(String((value * 100) / totalValue).split('.')[0]);
@@ -30,9 +30,9 @@ const Speedometer = ({ value, totalValue, size, outerColor, innerColor, internal
3030

3131
return (
3232
<View style={style}>
33-
<View style={[styles.outerCircle, { backgroundColor: outerColor }]}>
34-
<View style={[styles.halfCircle, degressStyle]}/>
35-
<View style={[styles.innerCircle, { backgroundColor: innerColor }]}>
33+
<View style={[styles.outerCircle, { backgroundColor: outerColor }, outerCircleStyle]}>
34+
<View style={[styles.halfCircle, degressStyle, halfCircleStyle]}/>
35+
<View style={[styles.innerCircle, { backgroundColor: innerColor }, innerCircleStyle]}>
3636
{percentElement}
3737
{textElement}
3838
</View>
@@ -60,6 +60,9 @@ Speedometer.propTypes = {
6060
labelStyle: PropTypes.object,
6161
showPercent: PropTypes.bool,
6262
percentStyle: PropTypes.object,
63+
innerCircleStyle: PropTypes.object,
64+
outerCircleStyle: PropTypes.object,
65+
halfCircleStyle: PropTypes.object,
6366
};
6467

6568
Speedometer.defaultProps = {

0 commit comments

Comments
 (0)