export default()

in frontend/src/common/components/prediction-plots/RechartsPredictionPlot.tsx [40:76]


export default ({ groups, data, historyMaxDate }: RechartsPredictionAPIResponse) => {
  return (
    <ResponsiveContainer width="100%">
      <LineChart
        data={data}
        margin={{
          top: 10,
          right: 10,
          left: 10,
          bottom: 10,
        }}
      >
        <CartesianGrid strokeDasharray="3 3" />
        <XAxis dataKey="name" tickFormatter={dateFormatter} />
        <YAxis />
        {/* <Tooltip /> */}
        <Legend />
        {groups.map((group, index) => (
          <Line
            key={group}
            type="monotone"
            dataKey={group}
            stroke={colors[index % colors.length]}
            activeDot={{ r: 8 }}
            dot={false}
          />
        ))}
        {historyMaxDate !== null ? (
          <>
            {/* <ReferenceLine x={predictionsMinDate} /> */}
            <ReferenceArea x2={historyMaxDate} fill="grey" fillOpacity={0.3} alwaysShow={true} />
          </>
        ) : null}
      </LineChart>
    </ResponsiveContainer>
  );
};