0.1.7 • Published 5 years ago

react-svg-donut v0.1.7

Weekly downloads
19
License
MIT
Repository
github
Last release
5 years ago

React SVG Donut Chart

An SVG-based React pie/donut chart component.

NPM

Installation

Add react-svg-donut to your project from the NPM registry.

yarn add react-svg-donut
npm install react-svg-donut

Demo

Visit GitHub page

Usage

import React from "react"
import DonutChart from "react-svg-donut"

const title="Movies"
const data = [
  {name: "Comedy", value: 4},
  {name: "Action", value: 5},
  {name: "Romance", value: 6},
  {name: "Drama", value: 1},
  {name: "SciFi", value: 4},
]

const MyComponent = () => (
  <DonutChart
    size={250}
    title={title}
    data={data}
    onHover={(i) => {
      if (i>=0) {
        console.log("Selected ", data[i].name)
      } else {
        console.log("Mouse left donut")
      }
    }
    innerRaduis={0.5}
    outerRadius={0.8}
    activeOffset={0.1}
  />
)
0.1.7

5 years ago

0.1.5

6 years ago

0.1.6

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago