0.0.16 • Published 2 years ago

react-native-donut-chart v0.0.16

Weekly downloads
-
License
None
Repository
github
Last release
2 years ago

React Native Donut Chart

This is a simple donut chart that accepts a data object like the following:

const data = [
  {
    value: 1,
    color: 'brown',
  },
  {
    value: 2,
    color: 'red',
  }, {
    value: 3,
    color: 'green',
  }, {
    value: 4,
    color: 'gold',
  }, {
    value: 5,
    color: 'blue',
  },
]

// ...

Then

import {Donut} from 'react-native-dinut-chart';

<Donut data={data}/>

Props:

KeyDescriptionTypeRequiredDefault
datachart dataArray of objectsTrue
radiusRadius of the donut chartnumberfalse80
fillThe chart fill color can be RGBAstringfalsetransparent
strokeWidthThe stroke width of the sectionsnumberfalse10
strokeLinejoinThe shape of the end of the strokesstringfalseround
gapThe gap / distance between the sectionsnumberfalse3
bgStrokeColorThe background stroke for the chartstringfalsegreen
bgStrokeOpacityThe background stroke opacitystringfalse.1
bgStrokePaddingThe additional thickness of the bg strokenumberfalse0

#Note:

This was a fast and quick hack to check the feasibility, more options can and will become available and a lot of improvements can be made.

Contributors are welcomed, please open an issue, explain what you want to do and after approved make your PR.

Here is a screenshot of the randomized sample data:

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.2

2 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago