# How can i change the x-axis labels for a date format in Kibana

**URL:** <https://discuss.elastic.co/t/how-can-i-change-the-x-axis-labels-for-a-date-format-in-kibana/564>\
**Category:** Kibana\
**Created:** [May 12, 2015, 4:13pm UTC](https://discuss.elastic.co/t/how-can-i-change-the-x-axis-labels-for-a-date-format-in-kibana/564 "2015-05-12T16:13:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rkhapre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rkhapre/32/48333_2.png) [@rkhapre](https://discuss.elastic.co/u/rkhapre)\
**Post date:** [May 12, 2015, 4:13pm UTC](https://discuss.elastic.co/t/how-can-i-change-the-x-axis-labels-for-a-date-format-in-kibana/564/1 "2015-05-12T16:13:37Z")

</div>

How can i change the x-axis labels for a date format in Kibana.  
Please see the below screenshot.

In below x-axis i want to change the date format and reduce the width

![](https://sea2.discourse-cdn.com/elastic/uploads/default/243/add1c92b8cc037ca.png)

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 12, 2015, 9:46pm UTC](https://discuss.elastic.co/t/how-can-i-change-the-x-axis-labels-for-a-date-format-in-kibana/564/2 "2015-05-12T21:46:27Z")

</div>

There is a global option that allows you to do this globally in Settings \>\> Advanced \>\> dateFormat:scaled.  
Change the default value to this, for instance, and you'll see date only even if data points are bucketed hourly:

```
[
["", "hh:mm:ss.SSS"],
["PT1S", "HH:mm:ss"],
["PT1M", "HH:mm"],
["PT1H",
"YYYY-MM-DD"],
["P1DT", "YYYY-MM-DD"],
["P1YT", "YYYY"]
]

```

If you always, always just want date, you can also make it simple and enter:

```
[["", "YYYY-MM-DD"]]

```

Please note though, this applies to _all_ date ranges for all visualisations.

---

<div class="post-metadata">

**Author:** ![GrahamHannington](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/grahamhannington/32/4404_2.png) [@GrahamHannington](https://discuss.elastic.co/u/GrahamHannington)\
**Post date:** [September 15, 2015, 4:17am UTC](https://discuss.elastic.co/t/how-can-i-change-the-x-axis-labels-for-a-date-format-in-kibana/564/3 "2015-09-15T04:17:13Z")

</div>

I have the same issue. I'm using Kibana 4.1.0.

However, in my case - a Date Range aggregation - `dateFormat:scaled` seems not to be the relevant setting.

I want, for example, "9am to 10am" (that is, format "ha") as an x-axis label, but I'm getting the full "MMMM Do YYYY, HH:mm:ss.SSS" format, which is the default format specified by the `dateFormat` setting, not the `dateFormat:scaled` setting: the formatted x-axis label values match this `dateFormat` pattern, not any of the patterns specified by `dateFormat:scaled`.

Setting `dateFormat` to "ha" works, but I don't want to specify "ha" as the global value for all cases; just for a particular visualization (I can also live with "just for a particular dashboard").

Is it possible to "inject" a value for `dateFormat` into the Kibana URL (query string), to override the global setting? (I'm already programmatically building the URL, so this is no extra burden.)

I thought perhaps specifying:

```
{ "format": "ha" }

```

in the **JSON Input** field for the Date Range aggregation might work, but nope.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 15, 2015, 5:05am UTC](https://discuss.elastic.co/t/how-can-i-change-the-x-axis-labels-for-a-date-format-in-kibana/564/4 "2015-09-15T05:05:01Z")

</div>

It's better if you start your own thread please, this one is pretty old.

---

<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:** [July 6, 2017, 2:13pm UTC](https://discuss.elastic.co/t/how-can-i-change-the-x-axis-labels-for-a-date-format-in-kibana/564/5 "2017-07-06T14:13:06Z")

</div>


