get the RIGHT first data point

This commit is contained in:
hackerESQ
2024-08-06 23:34:11 -05:00
parent 74daae5b26
commit 66ff5c360f
@@ -95,7 +95,7 @@
y: {
formatter: (value, { series, seriesIndex, dataPointIndex, w }) => {
const firstDataPoint = this.data.series[seriesIndex].data[1][1]
const firstDataPoint = this.data.series[seriesIndex].data[0][1]
const percentageChange = ((value - firstDataPoint) / firstDataPoint) * 100;
return `${value} (${percentageChange.toFixed(2)}%)`;
}