Created
April 1, 2018 06:36
-
-
Save kocisov/07169c4870cff8ff80f7011e265c9813 to your computer and use it in GitHub Desktop.
Revisions
-
kocisov created this gist
Apr 1, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ import * as React from 'react' import { render } from 'react-dom' import { PieChart, Pie, Cell } from 'recharts' const data = [ { name: 'Low thing', value: 3, color: '#d0d0d0', }, { name: 'Medium thing', value: 20, color: '#e2e', }, ] const Chart = ( <PieChart width={250} height={250}> <Pie data={data} dataKey="value" nameKey="name" innerRadius={55} outerRadius={80} > {data.map((entry, index) => ( <Cell key={`cell-${index}`} fill={entry.color} /> ))} </Pie> </PieChart> ) const node = document.getElementById('root') render(<Chart />, node)