Skip to content

Commit 1a20d84

Browse files
Fix the issue with animated particle chart
1 parent ff0ef4b commit 1a20d84

File tree

1 file changed

+7
-1
lines changed
  • src/KeyInsights/Components/AnimatedParticleChart

1 file changed

+7
-1
lines changed

src/KeyInsights/Components/AnimatedParticleChart/index.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,13 @@ export function ParticleColumnChart(props: ColumnProps) {
101101
];
102102
const finalYear =
103103
dataForIndicator.yearlyData[dataForIndicator.yearlyData.length - 1]
104-
.year;
104+
.year <
105+
populationTotal.yearlyData[populationTotal.yearlyData.length - 1].year
106+
? dataForIndicator.yearlyData[
107+
dataForIndicator.yearlyData.length - 1
108+
].year
109+
: populationTotal.yearlyData[populationTotal.yearlyData.length - 1]
110+
.year;
105111
const years = baseYears.map(d => d);
106112
years.push(finalYear);
107113
const dataList = years.map(el =>

0 commit comments

Comments
 (0)