# Xaxis hover information

**URL:** <https://community.plotly.com/t/xaxis-hover-information/46534>\
**Category:** plotly.js\
**Created:** [October 27, 2020, 10:46am UTC](https://community.plotly.com/t/xaxis-hover-information/46534 "2020-10-27T10:46:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![billyJean](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@billyJean](https://community.plotly.com/u/billyJean)\
**Post date:** [October 27, 2020, 10:46am UTC](https://community.plotly.com/t/xaxis-hover-information/46534/1 "2020-10-27T10:46:25Z")

</div>

I’m not sure if this is possible atm in plotly: I have stacked bar charts with data from different sources. On the xaxis I want a short label (this is done by `ticktext` and `tickvals`) but I need an extend text on hover.

I don’t want to change the format but change the whole hover information displayed.

So in my case I want to display `AT - [additional information]` instead of `AT`:  
 ![hover](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/7/761a43237e02b4e1028d4af7210fbc0c7f1ea515.png)

---

<div class="post-metadata">

**Author:** ![archmoj](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/archmoj/32/8388_2.png) [@archmoj](https://community.plotly.com/u/archmoj)\
**Post date:** [October 28, 2020, 1:12pm UTC](https://community.plotly.com/t/xaxis-hover-information/46534/2 "2020-10-28T13:12:14Z")

</div>

Instead of ticktext, have you tried category axis of short labels and putting additional text in `text`?  
Here is a [demo](https://codepen.io/MojtabaSamimi/pen/wvWpLdw?editors=0010).

---

<div class="post-metadata">

**Author:** ![billyJean](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@billyJean](https://community.plotly.com/u/billyJean)\
**Post date:** [October 28, 2020, 3:03pm UTC](https://community.plotly.com/t/xaxis-hover-information/46534/3 "2020-10-28T15:03:04Z")

</div>

Thank you for the suggestion. The `hovertemplate` is interesting especially in combination with `text`. But atm I’m looking for another effect. My screenshot in the first post might be misleading: I want to change the `xaxis` tooltip. My need is to have a short `ticklabel` and a long version in the tooltip (the dark grey one on the xaxis).

---

<div class="post-metadata">

**Author:** ![archmoj](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/archmoj/32/8388_2.png) [@archmoj](https://community.plotly.com/u/archmoj)\
**Post date:** [October 28, 2020, 3:15pm UTC](https://community.plotly.com/t/xaxis-hover-information/46534/4 "2020-10-28T15:15:05Z")

</div>

@antrg any idea how one may possibly achieve that?
