React-native-svg-charts: How can I implement linear gradient stroke for ProgressCircle

Created on 23 Dec 2019  路  2Comments  路  Source: JesperLekland/react-native-svg-charts

NOT A BUG but also not a feature, sorry if its not the proper place to ask!

I took an inspiration from the examples
How can I implement linear gradient stroke for ProgressCircle component? this is my code at the moment (I took an inspiration from the examples ):

const Gradient = () => (
  <Defs key={'gradient'}>
      <LinearGradient id={'gradient'} x1={'0%'} y={'0%'} x2={'0%'} y2={'100%'}>
          <Stop offset={'0%'} stopColor={'rgb(134, 65, 244)'}/>
          <Stop offset={'100%'} stopColor={'rgb(66, 194, 244)'}/>
      </LinearGradient>
  </Defs>
)

      <ProgressCircle
        svg={{
          strokeWidth: 2,
          fill: 'url(#gradient)',
        }}
        strokeWidth={20}
        style={{ height: 200 }} 
        progress={0.7} 
        progressColor={Colors.themePurple}>
        <Gradient/>
      </ProgressCircle>

End result should be something around this:

Thank you!!! (:

bug

Most helpful comment

All 2 comments

@7laria Nice! thank you (:

Was this page helpful?
0 / 5 - 0 ratings