import React from 'react'; import PropTypes from 'prop-types'; import { ResponsiveLine } from '@nivo/line'; import './Line.css'; const Line = props => ( props.data && (props.color)} tooltip={slice => (
{slice.data.map(d => (
{d.data.y}
{d.data.x}
))}
)} theme={{ tooltip: { container: { padding: '0', background: '#333', borderRadius: '4px', }, }, }} /> ); Line.propTypes = { data: PropTypes.array.isRequired, color: PropTypes.string.isRequired, }; export default Line;