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/10bff55332bddd5260aeae0beda4c7ce to your computer and use it in GitHub Desktop.
Save hadnazzar/10bff55332bddd5260aeae0beda4c7ce to your computer and use it in GitHub Desktop.
import React from 'react';
import {Line} from 'react-chartjs-2';
const data = {
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
datasets: [
{
label: 'My First dataset',
fill: false,
lineTension: 0.1,
backgroundColor: 'rgba(75,192,192,0.4)',
borderColor: 'rgba(75,192,192,1)',
borderCapStyle: 'butt',
borderDash: [],
borderDashOffset: 0.0,
borderJoinStyle: 'miter',
pointBorderColor: 'rgba(75,192,192,1)',
pointBackgroundColor: '#fff',
pointBorderWidth: 1,
pointHoverRadius: 5,
pointHoverBackgroundColor: 'rgba(75,192,192,1)',
pointHoverBorderColor: 'rgba(220,220,220,1)',
pointHoverBorderWidth: 2,
pointRadius: 1,
pointHitRadius: 10,
data: [65, 59, 80, 81, 56, 55, 40]
}
]
};
export default () => (
<div>
<h2>Line Example</h2>
<Line
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