@creaditor/minimal-pie-chart-editor-component

1.0.45 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @creaditor/minimal-pie-chart-editor-component

Weekly Downloads

2

Version

1.0.45

License

MIT

Unpacked Size

6.68 MB

Total Files

6

Last publish

Collaborators

  • creaditor