Created
July 1, 2020 00:45
-
-
Save hadnazzar/091baa73149d220860581c3ab4e1bded 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 {HorizontalBar} from 'react-chartjs-2'; | |
const data = { | |
labels: ['January', 'February', 'March', 'April', 'May', 'June'], | |
datasets: [ | |
{ | |
label: 'Dataset', | |
backgroundColor: 'rgba(255,99,132,0.2)', | |
borderColor: 'rgb(11,227,210)', | |
borderWidth: 1, | |
hoverBackgroundColor: 'rgba(255,0,54,0.4)', | |
hoverBorderColor: 'rgb(0,88,101)', | |
data: [65, 59, 80, 81, 56, 55, 40] | |
} | |
] | |
}; | |
export default () => ( | |
<div> | |
<h2>Horizontal Bar Example</h2> | |
<HorizontalBar | |
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