Created
July 1, 2020 00:46
-
-
Save hadnazzar/5e5d4180418cf852151ca435e7f4637f to your computer and use it in GitHub Desktop.
This file contains 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 characters
import React from 'react'; | |
import {Line, Pie} from 'react-chartjs-2'; | |
const data = { | |
labels: [ | |
'Red', | |
'Blue', | |
'Yellow' | |
], | |
datasets: [{ | |
data: [300, 50, 100], | |
backgroundColor: [ | |
'#FF6384', | |
'#36A2EB', | |
'#FFCE56' | |
], | |
hoverBackgroundColor: [ | |
'#FF6384', | |
'#36A2EB', | |
'#FFCE56' | |
] | |
}] | |
}; | |
export default () => ( | |
<div> | |
<h2>Pie Example</h2> | |
<Pie | |
data={data} | |
width={400} | |
height={400} | |
/> | |
</div> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment