1.0.45 • Published 2 years ago

@creaditor/minimal-pie-chart-editor-component v1.0.45

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

minimal-pie-chart-editor-component

Made with create-react-library

NPM JavaScript Style Guide

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

1.0.45

2 years ago

1.0.44

2 years ago

1.0.43

2 years ago