diff --git a/src/components/Chart/TimeseriesBarChart.js b/src/components/Chart/TimeseriesBarChart.js index 736056b..ba7a6a2 100644 --- a/src/components/Chart/TimeseriesBarChart.js +++ b/src/components/Chart/TimeseriesBarChart.js @@ -13,9 +13,15 @@ import { import { SectionTitle } from "../Typography/Title"; -function TimeseriesBarChart({ name, data, dataKeys, colors }) { +function TimeseriesBarChart({ name, data, dataKeys = [], colors = [] }) { const { mode } = useContext(WindmillContext); + // Ensure dataKeys and colors are matched + if (dataKeys.length !== colors.length) { + console.error("The number of dataKeys must match the number of colors."); + return null; + } + return (