Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
feat: imported LineGraph component and rendered it with dumby data
Browse files Browse the repository at this point in the history
  • Loading branch information
yosephAHMED committed Aug 16, 2020
1 parent 8d04353 commit 7cc66eb
Showing 1 changed file with 40 additions and 2 deletions.
42 changes: 40 additions & 2 deletions src/incidents/visualize/VisualizeIncidents.tsx
@@ -1,4 +1,4 @@
import { Spinner } from '@hospitalrun/components'
import { Spinner, LineGraph } from '@hospitalrun/components'
import React from 'react'

import useIncidents from '../hooks/useIncidents'
Expand All @@ -14,10 +14,48 @@ const VisualizeIncidents = () => {
return <Spinner type="DotLoader" loading />
}

// reportedOn: "2020-08-12T19:53:30.153Z"
// we can use a function that splices the string at position 6-7 to get the month

console.log('data: ', data)
return (
<>
<h1>Hello from Visualize Incidents</h1>
<LineGraph
datasets={[
{
backgroundColor: 'blue',
borderColor: 'red',
data: [
{
x: 'January',
y: 12,
},
{
x: 'February',
y: 11,
},
{
x: 'March',
y: 10,
},
],
label: 'Incidents',
},
]}
title="Reported Incidents Overtime"
xAxes={[
{
label: 'Months',
type: 'category',
},
]}
yAxes={[
{
label: 'Numbers',
type: 'linear',
},
]}
/>
</>
)
}
Expand Down

0 comments on commit 7cc66eb

Please sign in to comment.