@creaditor/minimal-pie-chart-editor-component
v1.0.45
Published
Made with create-react-library
Downloads
2
Readme
minimal-pie-chart-editor-component
Made with create-react-library
Install
npm install --save minimal-pie-chart-editor-component
Usage
import * as React from 'react'
import { PieChart } from 'react-minimal-pie-chart'
const App = (props) => {
const linewWidth = props.lineWidth ? props.lineWidth : 60
return (
<PieChart
style={{ height: props.size || '200px' }}
data={props.data}
startAngle={props.startAngle}
lengthAngle={props.lengthAngle}
lineWidth={linewWidth}
viewBoxSize={props.viewBoxSize}
label={({ dataEntry }) => Math.round(dataEntry.percentage) + '%'}
labelPosition={100 - linewWidth / 2}
animate
segmentsStyle={{ transition: 'stroke .3s', cursor: 'pointer' }}
labelStyle={{
fill: '#fff',
opacity: 0.75,
pointerEvents: 'none',
fontSize: '.6rem',
fontFamily: 'arial'
}}
/>
)
}
export default App
License
MIT © adi-L