# Hovertemplate does not show 'name' property

**URL:** <https://community.plotly.com/t/hovertemplate-does-not-show-name-property/36139>\
**Category:** 📊 Plotly Python\
**Created:** [March 12, 2020, 5:51pm UTC](https://community.plotly.com/t/hovertemplate-does-not-show-name-property/36139 "2020-03-12T17:51:09Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ngaudio](https://avatars.discourse-cdn.com/v4/letter/n/58f4c7/32.png) [@ngaudio](https://community.plotly.com/u/ngaudio)\
**Post date:** [March 12, 2020, 5:51pm UTC](https://community.plotly.com/t/hovertemplate-does-not-show-name-property/36139/1 "2020-03-12T17:51:09Z")

</div>

Hello,

I’m trying to create a hovertemplate for a scatter plot to show the name of the data series, but when I hover over the series, all that shows is `%{name}`. The other chart properties, `x`, `y`, and `text` all display properly.

Below is the code I’m using:

```auto
fig.add_trace(go.Scatter(
                        x = timestamp_dates_slew, 
                        y = slew_duration_slew, 
                        name = VALID_SLEW_TO_MODES[j],
                        text = [f'{dt.datetime.strftime(d, "%Y-%m-%dT%H:%M:%S")}' for d in timestamp_dt],
                        mode = "markers",
                        hovertemplate = 
                        '%{name}' +
                        '<br><br>' +
                        '<b>Timestamp:</b> %{text}<br>' +
                        '<b>Duration:</b> %{y} sec<extra></extra>',
                        marker = dict(
                                size = 5,
                                color = COLORS[j]
                                ),
                        showlegend=True if VALID_SLEW_TO_MODES[j] not in trace_names else False), 
                        row=1, col=(SPACECRAFT_ID.index(sc)+1))

```

Below is the output

 ![image](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/5/54bd1a07157f34ea0ba34dcf9aa1aa287189794a.png)

How can I get the series name to show up in the hoverdata?

Thank you for your help!

---

<div class="post-metadata">

**Author:** ![Emmanuelle](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/emmanuelle/32/7853_2.png) [@Emmanuelle](https://community.plotly.com/u/Emmanuelle)\
**Post date:** [March 12, 2020, 7:15pm UTC](https://community.plotly.com/t/hovertemplate-does-not-show-name-property/36139/2 "2020-03-12T19:15:51Z")

</div>

Hi @ngaudio you could use the `meta` attribute to define values to be accessed within the hovertemplate, for example

```auto
name="my trace"
import plotly.graph_objects as go
fig = go.Figure(go.Scatter(x=[1, 2], y=[2, 1], name=name, meta=[name],
                          hovertemplate='%{meta[0]} Data %{y}'))
fig.show()

```

(or if you just want one meta value:

```auto
name="my trace"
import plotly.graph_objects as go
fig = go.Figure(go.Scatter(x=[1, 2], y=[2, 1], name=name, meta=name,
                          hovertemplate='%{meta} Data %{y}'))
fig.show()

```

)

---

<div class="post-metadata">

**Author:** ![ngaudio](https://avatars.discourse-cdn.com/v4/letter/n/58f4c7/32.png) [@ngaudio](https://community.plotly.com/u/ngaudio)\
**Post date:** [March 12, 2020, 9:15pm UTC](https://community.plotly.com/t/hovertemplate-does-not-show-name-property/36139/3 "2020-03-12T21:15:03Z")

</div>

Excellent! Thank you @Emmanuelle. It worked perfectly.

---

<div class="post-metadata">

**Author:** ![emoredo](https://avatars.discourse-cdn.com/v4/letter/e/77aa72/32.png) [@emoredo](https://community.plotly.com/u/emoredo)\
**Post date:** [April 28, 2021, 3:54pm UTC](https://community.plotly.com/t/hovertemplate-does-not-show-name-property/36139/4 "2021-04-28T15:54:43Z")

</div>

Could you please add these to:

> **[Hover Text and Formatting](https://plotly.com/python/hover-text-and-formatting/#customizing-hover-text-with-a-hovertemplate)**
>
> How to use hover text and formatting in Python with Plotly.

Nowhere this meta attribute is mentioned??

---

<div class="post-metadata">

**Author:** ![mbkupfer](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/mbkupfer/32/4334_2.png) [@mbkupfer](https://community.plotly.com/u/mbkupfer)\
**Post date:** [May 28, 2021, 1:01am UTC](https://community.plotly.com/t/hovertemplate-does-not-show-name-property/36139/5 "2021-05-28T01:01:37Z")

</div>

Better yet, could there be a definitive resource on the available template variables for `hovertemplate`? I feel like this type of documentation is greatly missing.

---

<div class="post-metadata">

**Author:** ![JuanMiguel](https://avatars.discourse-cdn.com/v4/letter/j/d9b06d/32.png) [@JuanMiguel](https://community.plotly.com/u/JuanMiguel)\
**Post date:** [July 22, 2023, 8:23pm UTC](https://community.plotly.com/t/hovertemplate-does-not-show-name-property/36139/6 "2023-07-22T20:23:49Z")

</div>

Second this!!

---

<div class="post-metadata">

**Author:** ![tomwhoiscontrary](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/tomwhoiscontrary/32/888_2.png) [@tomwhoiscontrary](https://community.plotly.com/u/tomwhoiscontrary)\
**Post date:** [June 25, 2026, 12:59pm UTC](https://community.plotly.com/t/hovertemplate-does-not-show-name-property/36139/7 "2026-06-25T12:59:42Z")

</div>

According to a message in an exception, the variables available are the fields of [the hover event](https://plotly.com/javascript/plotlyjs-events/#event-data). I agree that this should be documented more prominently!

In particular, a useful field is fullData, which is the trace that was hovered over. So you can use `%{fullData.name}` to get the name of the trace.
