Skip to content

Instantly share code, notes, and snippets.

@hadnazzar
Created July 1, 2020 00:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hadnazzar/5e5d4180418cf852151ca435e7f4637f to your computer and use it in GitHub Desktop.
Save hadnazzar/5e5d4180418cf852151ca435e7f4637f to your computer and use it in GitHub Desktop.
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