react-native-circular-progress icon indicating copy to clipboard operation
react-native-circular-progress copied to clipboard

Customize the maximum value of full circle

Open WrathChaos opened this issue 3 years ago • 4 comments

I added a new prop for maximum value which was 100 and its default is 100 now. I need to set a totally different maximum value logic and this prop simply solves it.

It makes the library more customizable now.

Thank you for the library tho! It is awesome! @bartgryszko

Here is the basic example of the maximumValue prop. In this example the maximumValue is 8 and fill is 2 so the circle is working with the maximum value now.

CleanShot 2021-07-28 at 1 10 53@2x

WrathChaos avatar Jul 27 '21 22:07 WrathChaos

When will this be merged? Looks like a good feature @bartgryszko

akhatriST avatar Oct 06 '21 07:10 akhatriST

You can reach this feature with this one:

"react-native-circular-progress": "github:WrathChaos/react-native-circular-progress",

I think he did not maintain the library anymore. Maybe I can fork it and maintain it. Let's see.

WrathChaos avatar Oct 06 '21 13:10 WrathChaos

Sure thanks 👍

akhatriST avatar Oct 07 '21 11:10 akhatriST

In case someone needs this feature with the current version we can just percentages. So below will fill the bar to 250 out of a max of 500.

const maxvalue = 500;
<AnimatedCircularProgress
          size={200}
          width={3}
          backgroundWidth={30}
          fill={(250 / maxvalue) * 100}
          tintColor="#00e0ff"
          backgroundColor="#3d5875"
        >
          {fill => <Text style={styles.points}>{Math.round((maxvalue* fill) / 100)}</Text>}
        </AnimatedCircularProgress>

SpeedOfSpin avatar Jan 26 '22 16:01 SpeedOfSpin