Is it possible to disable hoverdata based on a condition?

I am having a really hard time trying to remove the hoverdata when the y value is equal to 0. Even with chatGPT help I couldn’t manage to remove it. Do you guys know how this can be done? I am using px.area from plotly express.


It looks one issue on px.area rendering. I try also some approach using manual rendering subplots but the issue remains.
You can see my issue here: Add xaxis limits to each subplot px.area
On my side the reason for y=0 is only because some lines/colors only exists on partial x range. Please confirm if is the same reason on your side?

Let see if some dev take that issue and start some solution…

Hi! Yes it is exactly the same issue. Basically the whole legend is visible on each x tick, even with nan values or when zooming on a specific part of the plot. I think it is a major issue, since it is very usual to have a large legend when plotting.