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