How to add info to hover name in y_unified mode?

Hello all and thanks in advance …

I have this view currently created:

but I want something similar to this:

that is, my state variable >> customdata[0] that appears repeatedly 4, only 1 appears.
Is this possible ?

this is my code:
img005

Hi @gabino.alonso,

With this kind of very specific questions, it is really hard to help without having the data and the complete code which generated the chart.

I would say it’s possible tweaking the hovertemplate.

Also, please provide your code in a way that it can be copy pasted.

1 Like

ok, my apologies for being so brief, I’ll try again :sweat_smile:

I am graphing a series of discrete variables (Y) against time (x)
What I want is that currently my variable β€˜state’ appears 4 times repeatedly and I would like it to only appear 1 time, for example in hovername.

but I am not able to add more values to β€œhover_name”

my code here:

        customdata = (df_monitor_prod['estado'])

        fig = px.line(df_monitor_prod,
                      x='t_produccion',
                      y=["rendimiento", "disponibilidad", "calidad", "oee"],
                      hover_name="estado",
                      markers=True, line_shape='spline',
                      color_discrete_sequence=px.colors.qualitative.Bold)

        fig.update_traces(hovertemplate='%{y} %{_yother} %{customdata[0]}')

        fig.update_layout(yaxis={'range': [0,110]},
                        showlegend=False,
                        hoverlabel_align = 'right',
                        hovermode="x unified",
                        legend=dict(x=0, y=1.0),
                        plot_bgcolor="#f9f9f9",
                        paper_bgcolor="#f9f9f9",
                        margin=dict(l=40, r=0, t=10, b=20))

Thanks a lot