0.1.14 • Published 17 days ago

react-svg-donut-chart-lib v0.1.14

Weekly downloads
-
License
MIT
Repository
github
Last release
17 days ago

react-svg-donut-chart-lib

A simple yet powerful React library to render donut charts using SVG. This library aims to provide an easy way to create donut charts with just a few lines of code.

Installation

To install react-svg-donut-chart-lib, run the following command:

npm install react-svg-donut-chart-lib

Usage

Here's how you can use react-svg-donut-chart-lib to create a donut chart:

import React from 'react';
import ReactDOM from 'react-dom';
import DonutChart from 'react-svg-donut-chart-lib';

const data = [
{ value: 50, color: '#f00' },
{ value: 30, color: '#0f0' },
{ value: 20, color: '#00f' },
];

const App = () => (
<DonutChart data={data} size={200} strokeWidth={20} />
);

ReactDOM.render(<App />, document.getElementById('root'));

Props

  • data: An array of objects representing the segments of the donut chart. Each object should have a value (number) and a color (string) property.
  • size: (Optional) The size (width and height) of the chart. Default is 200.
  • strokeWidth: (Optional) The width of the chart's stroke. Default is 20.
0.1.13

17 days ago

0.1.14

17 days ago

0.1.12

1 month ago

0.0.11

2 months ago