# Display xaxis ticklabel on hover text rather than x

**URL:** <https://community.plotly.com/t/display-xaxis-ticklabel-on-hover-text-rather-than-x/64564>\
**Category:** plotly.js\
**Tags:** question\
**Created:** [May 27, 2022, 12:11pm UTC](https://community.plotly.com/t/display-xaxis-ticklabel-on-hover-text-rather-than-x/64564 "2022-05-27T12:11:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MGans](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@MGans](https://community.plotly.com/u/MGans)\
**Post date:** [May 27, 2022, 12:11pm UTC](https://community.plotly.com/t/display-xaxis-ticklabel-on-hover-text-rather-than-x/64564/1 "2022-05-27T12:11:04Z")

</div>

Hello! I was wondering how I’d modify the `"X: %{x:.0}<br>"` below so that my custom hover can read `X: label` and not the numeric x value? For example,` X: a` not `X: 1`

I’ve tried using xaxis.ticklabel but that displays ALL the tick labels and not the one of the current point. Anyone have any pointers??

```auto
<head>
	<script src='https://cdn.plot.ly/plotly-latest.min.js'></script>
</head>

<body>
	<div id='myDiv'></div>
</body>

```

```auto
let trace1 = {
        x: [1,2,3],
        y: [1,2,3],
        hovertemplate:
            "Y: %{y:.0}<br>" +
            "X: %{x:.0}<br>" +
            "<extra></extra>",
        type: 'scattergl',
        mode: 'lines',
};

var layout = {
    xaxis: {
      tickvals: [1,2,3],
      ticktext: ["a", "b", "c"],
    }
  }

Plotly.plot('myDiv', [trace1], layout)

```

---

<div class="post-metadata">

**Author:** ![MGans](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@MGans](https://community.plotly.com/u/MGans)\
**Post date:** [May 27, 2022, 12:13pm UTC](https://community.plotly.com/t/display-xaxis-ticklabel-on-hover-text-rather-than-x/64564/2 "2022-05-27T12:13:52Z")

</div>

Answering my own question! We can do this by just saying %{x} !!! I’m curious if there’s docs around the string syntax for custom hovers?
