Black Lives Matter. Please consider donating to Black Girls Code today.
Dash HoloViews is now available! Check out the docs.

Axis hover formatting with function

I have a date x axis, and I need to show DAY or NIGHT on hover, instead of actual date. I can’t achieve it with d3 time formatting string.
Would be great to be able to pass a function, that would calculate the hover text based on the x value, ie:
layout.xaxis.hoverformat: function(date) { // determinte DAY, NIGHT, whatever from the date; }

plotly.js attempts to make every chart attribute JSON serializable, that is custom functions won’t be part of our API for the foreseeable future.

Here are two possible workarounds:

1 Like

Thank you.
Customizing hover values seems like a solution for me. But I have grouped bar chart, and getting same hover for every trace.

Is there a way to have single hover for a whole group?

Not at the moment. Hover labels are generated per trace.