Cl React Graphs

Pie Chart

  • bin 1
  • bin 2
  • bin 3 with a long name
  • bin 4
  • bin 5
  • bin 6
  • bin 7
4%7%11%14%18%21%25%4%33%23%14%2%1%22%
import {
PieChart,
useWidth,
} from 'cl-react-graph;
const data = {
bins: [
'bin 1',
'bin 2',
'bin 3 with a long name',
'bin 4',
'bin 5',
'bin 6',
'bin 7'
],
counts: [
{
data: [1, 2, 3, 4, 5, 6, 7],
},
],
};
const MyComponent = () => {
const [ref, width] = useWidth('90%');
return(
<div ref={ref}>
<PieChart
width={400}
height={400}
labels={{
display: true,
}}
data={data} />
</div>
)
};