import React from 'react' const Pie = require('react-simple-pie-chart') class PieChart extends React.Component { constructor(props: any) { super(props) this.state = { expandedSector: null } this.handleMouseEnterOnSector = this.handleMouseEnterOnSector.bind(this) this.handleMouseLeaveFromSector = this.handleMouseLeaveFromSector.bind(this) } handleMouseEnterOnSector(sector: any) { this.setState({ expandedSector: sector }) } handleMouseLeaveFromSector() { this.setState({ expandedSector: null }) } render() { return (
{ this.props.data.map((d: any, i: number) => (
OO { d.label }: { d.value }
)) } { this.props.total ?
Total: {this.props.total}
: '' } How our marking works
) } } export { PieChart }