npm.io
0.0.2 • Published 2 years ago

react-native-customize-donut-chart

Licence
ISC
Version
0.0.2
Deps
1
Size
7 kB
Vulns
0
Weekly
0

react-native-customize-donut-chart

The simple customizable donut chart component for the React Native app supports both iOS and Android.

Screenshots

Screenshot 2023-12-04 at 15 41 03Screenshot 2023-12-04 at 15 40 52

Demo

https://github.com/dasuntn/react-native-customize-donut-chart/assets/15120571/31ad57cd-64ee-4573-81a9-45a2153d4cb5

Features

  • Cross platform
  • Donut slice is clickable
  • Custom colors can be passed
  • Add any component to center of the donut

Installation

Required dependencies

Install react-native-customize-donut-chart with npm

  npm install react-native-customize-donut-chart

Usage/Examples

import React from "react";
import DonutChart from "react-native-customize-donut-chart";

const exampleData = [{ value: 10 }, { value: 20 }, { value: 40 }];

const ChartComponent = () => {
  return <DonutChart data={exampleData} />;
};

export default ChartComponent;

Props

Property Type Required
data {value: number}[] yes
size number no
sliceColors string[] no
centerCircle { isEnable: boolean; color: string } no
percentage { visible: boolean; textStyle?: { color: string } } no
onSlicePress function no

Keywords