Here is another one for ya Tanner :P
When the chart is initially rendered at certain widths, it doesn't seem to be filling the parent container properly.
It initially has a bunch of extra space on the bottom and the xaxis overflows the right side of the container.

However when moving the dev tools panel over 1px the chart resizes and snaps to the position I would expect on initial render.

import React from 'react';
import { Chart } from 'react-charts';
export default function CustomChart() {
const primaryAxis = React.useMemo(
() => ({
isPrimary: true,
scaleType: 'time',
position: 'bottom',
getValue: (datum) => datum.primary,
}),
[]
);
const secondaryAxes = React.useMemo(
() => [
{
scaleType: 'linear',
position: 'left',
getValue: (datum) => datum.secondary,
elementType: 'line',
},
],
[]
);
return (
<div style={{ height: 300, border: '1px solid black' }}>
<Chart
options={{
data,
primaryAxis,
secondaryAxes,
}}
/>
</div>
);
}
const data = [
{
label: 'Series 1',
data: [
{
primary: new Date('2021-07-18T00:00:00.000Z'),
secondary: 100,
},
{
primary: new Date('2021-07-19T00:00:00.000Z'),
secondary: 36,
},
{
primary: new Date('2021-07-20T00:00:00.000Z'),
secondary: 20,
},
{
primary: new Date('2021-07-21T00:00:00.000Z'),
secondary: 30,
},
{
primary: new Date('2021-07-22T00:00:00.000Z'),
secondary: 92,
},
{
primary: new Date('2021-07-23T00:00:00.000Z'),
secondary: 85,
},
{
primary: new Date('2021-07-24T00:00:00.000Z'),
secondary: 45,
},
{
primary: new Date('2021-07-25T00:00:00.000Z'),
secondary: 60,
},
{
primary: new Date('2021-07-26T00:00:00.000Z'),
secondary: 16,
},
{
primary: new Date('2021-07-27T00:00:00.000Z'),
secondary: 16,
},
{
primary: new Date('2021-07-28T00:00:00.000Z'),
secondary: 16,
},
],
},
{
label: 'Series 2',
data: [
{
primary: new Date('2021-07-18T00:00:00.000Z'),
secondary: 10,
},
{
primary: new Date('2021-07-19T00:00:00.000Z'),
secondary: 85,
},
{
primary: new Date('2021-07-20T00:00:00.000Z'),
secondary: 90,
},
{
primary: new Date('2021-07-21T00:00:00.000Z'),
secondary: 15,
},
{
primary: new Date('2021-07-22T00:00:00.000Z'),
secondary: 60,
},
{
primary: new Date('2021-07-23T00:00:00.000Z'),
secondary: 18,
},
{
primary: new Date('2021-07-24T00:00:00.000Z'),
secondary: 63,
},
{
primary: new Date('2021-07-25T00:00:00.000Z'),
secondary: 87,
},
{
primary: new Date('2021-07-26T00:00:00.000Z'),
secondary: 23,
},
{
primary: new Date('2021-07-27T00:00:00.000Z'),
secondary: 83,
},
{
primary: new Date('2021-07-28T00:00:00.000Z'),
secondary: 83,
},
],
},
];