graph-donut

1.0.27 • Public • Published

React Donut Graph

A simple donut graph for React.JS.


Quickly change attributes of the graph


Install npm i donut-graph --save Or Yarn Yarn add donut-graph

Use import DonutGraph from 'graph-donut

let PropTypes = {
    data: React.PropTypes.array, // array of objects to use for data points | Default []
    valuelabel: React.PropTypes.string, // label for the chart  | Default ('ValueLabel')
    text: React.PropTypes.string, // text inside the chart | Default ('')
    size: React.PropTypes.number, // diameter of chart | Default (150)
    strokewidth: React.PropTypes.number, // width of chart line | Default (20)
    donutchartTextValStyle: React.PropTypes.object, //React CSS Object for Text Value | Default ({})
    donutchartTextLabelStyle: React.PropTypes.object, //React CSS Object for Text Label | Default ({})
    donutchartTextStyle: React.PropTypes.object //React CSS Object for Text | Default ({})
}

Example Usage

import DonutGraph from 'graph-donut';
import React from 'react';
 
let data = [
    {
        "value": 10, // number out of 100
        "stroke": "blue",
        "offset": 0
    }
]
 
React.render(<DonutGraph data={data} valuelabel={"TICKETS ENTERED"} text={`${10}/100`} />, document.getElementById('main'))

Package Sidebar

Install

npm i graph-donut

Weekly Downloads

0

Version

1.0.27

License

MIT

Unpacked Size

58.9 kB

Total Files

9

Last publish

Collaborators

  • creativebuilds