diff --git a/src/visits/helpers/DefaultChart.tsx b/src/visits/helpers/DefaultChart.tsx index 1694d52a..73107748 100644 --- a/src/visits/helpers/DefaultChart.tsx +++ b/src/visits/helpers/DefaultChart.tsx @@ -150,6 +150,7 @@ const DefaultChart = memo(( const chartData = generateChartData(isBarChart, labels, data, highlightedData, highlightedLabel); const height = determineHeight(isBarChart, labels); + // Provide a key based on the height, to force re-render every time the dataset changes (example, due to pagination) const renderChartComponent = (customKey: string) => ( { @@ -163,7 +164,6 @@ const DefaultChart = memo(( /> ); - // Provide a key based on the height, so that every time the dataset changes, a new chart is rendered return (