Announcing Dash Bio 1.0.0 🎉 : a one-stop-shop for bioinformatics and drug development visualizations.

[Stacked area chart] Prevent hovering on empty data

I’m displaying a stacked area chart, but missing values mess up with the hover behavior:

  • when any value is either missing or null/zero, you can only see the hover of the last added marker, thus a nulll/zero/empty one
  • when values are missing, the hovertemplate cannot be interpolated, thus is displayed as is

This leads to the amazingly beautiful caption below:

Any thoughts on how to fix/work around this ?

Only way to bypass this behavior imo is to “fill” your dataframe, i.e. replace absent values by zeroes in your dataframe (e.g. in your example having a value corresponding to 0 for orange label in your dataframe).

AFAIK there is no conditionnal hovering yet so the only way to get rid of the weird un-interpolated hovertemplate is to prevent having absence of values in your dataframe.