# Change format of labels in a visualization X axis chart

**URL:** <https://discuss.elastic.co/t/change-format-of-labels-in-a-visualization-x-axis-chart/265131>\
**Category:** Kibana\
**Created:** [February 22, 2021, 10:20pm UTC](https://discuss.elastic.co/t/change-format-of-labels-in-a-visualization-x-axis-chart/265131 "2021-02-22T22:20:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![fefontana](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fefontana/32/62843_2.png) [@fefontana](https://discuss.elastic.co/u/fefontana)\
**Post date:** [February 22, 2021, 10:20pm UTC](https://discuss.elastic.co/t/change-format-of-labels-in-a-visualization-x-axis-chart/265131/1 "2021-02-22T22:20:01Z")

</div>

Hello, I'd like to know if it is possible to change the format of the labels at the chart axis in visualizations. An image with an example is attached.

 ![2021-02-22_19-13-13](https://us1.discourse-cdn.com/elastic/original/3X/5/c/5cdd2c9f5db8a308cd9f3b73ba2e9e7d81ab229a.png)

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [February 24, 2021, 8:29am UTC](https://discuss.elastic.co/t/change-format-of-labels-in-a-visualization-x-axis-chart/265131/2 "2021-02-24T08:29:51Z")

</div>

It's not possible to change the orientation in Lens, I created a feature request for this here: [[Lens] Allow configuration of axis labels orientation · Issue #92574 · elastic/kibana · GitHub](https://github.com/elastic/kibana/issues/92574) Alternatively you can use the legacy visualizations (select the "Aggregation based" tile in the bottom left in the modal, then use vertical bar or area chart). In there you can use the "Align" setting in the "Metrics & Axes" tab to change the orientation.

You can change the format by editing the `dateFormat:scaled` advanced setting in the Management section. This formatting is trying to adjust the format to the time range - if you are looking at just the last few hours, it will show hour and minute, if you are looking at the last year, it will show date without time and so on.

Keep in mind this setting is applied to all date x-axes in the current space. There's an open feature request for allowing custom date formats on the chart level ([[Lens] Date formatter · Issue #67206 · elastic/kibana · GitHub](https://github.com/elastic/kibana/issues/67206)).

---

<div class="post-metadata">

**Author:** ![fefontana](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fefontana/32/62843_2.png) [@fefontana](https://discuss.elastic.co/u/fefontana)\
**Post date:** [February 24, 2021, 2:12pm UTC](https://discuss.elastic.co/t/change-format-of-labels-in-a-visualization-x-axis-chart/265131/3 "2021-02-24T14:12:58Z")

</div>

Thank you Joe for your answer. I forgot to tell that I also would like to be able to show every legend according with the interval selected, i.e., if the time range is 2021-01-01 to 2021-01-10, I expect to see in the correcponding axis (X or Y) the following legends: 2021-01-01, 2021-01-02, 2021-01-03, 2021-01-04, 2021-01-05, . . . . . . . , 2021-01-09, 2021-01-10.

 ![2021-02-24_11-04-44](https://us1.discourse-cdn.com/elastic/original/3X/1/d/1d610110ac05e87c0bd830d9bf20c12d3649ed4e.png)

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [February 24, 2021, 2:37pm UTC](https://discuss.elastic.co/t/change-format-of-labels-in-a-visualization-x-axis-chart/265131/4 "2021-02-24T14:37:59Z")

</div>

That's not possible in Kibana today - all chart implementations will find good points in time to place ticks for continuous scales like dates.

You might be able to work around this a bit by using a scripted field to turn the date into a string of the granularity you want (e.g. daily) and use the "Top values" function instead, but it has various other downsides.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 24, 2021, 2:38pm UTC](https://discuss.elastic.co/t/change-format-of-labels-in-a-visualization-x-axis-chart/265131/5 "2021-03-24T14:38:39Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
