recharts / recharts

Redefined chart library built with React and D3
http://recharts.org
MIT License
24k stars 1.7k forks source link

Phantom points on multiple time series in tooltip #2489

Closed cbaker closed 3 years ago

cbaker commented 3 years ago

Reproduction link

Edit on CodeSandbox

Steps to reproduce

Hover over to draw the tooltip and there will be "phantom" points as I call them with no active dot where the values seem to be inherited from each other.

What is expected?

If there is no value for hovered time, do not show the value.

What is actually happening?

An inherited value of sorts is being displayed in the tooltip.

Environment Info
Recharts v2.0.8
React 16.14
System 20.10
Browser Chrome 89.0.4389.72

Downsampling time-series data for each series with LTTB before render. I think the problem is that the two series don't start at the same time so idx 0 is at different times on each line?

cbaker commented 3 years ago

use allowDuplicatedCategory={false} I do note, this isn't an obvious prop for an XAxis of type "number" vs type "category"