Open agmt92 opened 3 weeks ago
The tooltip is displaying the wrong months for the corresponding month on the y-axis. Additionally, the tooltip is displaying the wrong year for the cells corresponding to January along the whole X-axis (all years).
Steps to reproduce the behavior:
The tooltip should display the correct month corresponding to the y-axis and the correct year for all cells, including those corresponding to January.
In my case the issue was easily solved by adding adding + 1 to the month value.
const tooltipFunct = (data) => { let year = data.year; let month = data.month; let variance = data.variance; let temperature = Math.floor((data.variance + 8.66) * 100) / 100; let result = `${year}, ${d3.utcFormat("%B")(d3.timeParse("%m")(month+1))} <br> Temperature:${temperature} <br> Variance: ${variance}℃`; return result; }
For reference:
Describe the bug
The tooltip is displaying the wrong months for the corresponding month on the y-axis. Additionally, the tooltip is displaying the wrong year for the cells corresponding to January along the whole X-axis (all years).
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The tooltip should display the correct month corresponding to the y-axis and the correct year for all cells, including those corresponding to January.
Screenshots
Device:
Additional context
In my case the issue was easily solved by adding adding + 1 to the month value.
That's a snippet of my code for returning the tooltip text correctly.
For reference: