Created
October 3, 2022 13:40
-
-
Save PaulieScanlon/844d871a014e1046f0d2f890d71e2a52 to your computer and use it in GitHub Desktop.
Setup Line Chart
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 PropTypes from 'prop-types'; | |
const LineChart = ({ data }) => { | |
const chartWidth = 1200; | |
const chartHeight = 600; | |
const offsetY = 40; | |
const paddingX = 50; | |
const paddingY = 90; | |
const maxY = Math.max(...data.map((item) => item.total)); | |
const guides = [...Array(16).keys()]; | |
return null; | |
}; | |
LineChart.propTypes = { | |
/** The shape of the data */ | |
data: PropTypes.arrayOf( | |
PropTypes.shape({ | |
total: PropTypes.number.isRequired, | |
date: PropTypes.string.isRequired | |
}) | |
).isRequired | |
}; | |
export default LineChart; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment