# How can I set X-axis time domain with 24hours?

**URL:** https://discuss.elastic.co/t/how-can-i-set-x-axis-time-domain-with-24hours/221383
**Category:** Kibana
**Created:** [February 28, 2020, 8:07am UTC](https://discuss.elastic.co/t/how-can-i-set-x-axis-time-domain-with-24hours/221383 "2020-02-28T08:07:26Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![m-amano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/m-amano/32/62977_2.png) [@m-amano](https://discuss.elastic.co/u/m-amano)
#### Post date: [February 28, 2020, 8:07am UTC](https://discuss.elastic.co/t/how-can-i-set-x-axis-time-domain-with-24hours/221383/1 "2020-02-28T08:07:27Z")

</div>

I want to make my vega-light graph x-axis starts from 0:00 to 24:00 below.

 ![sample_bar_20200228](https://us1.discourse-cdn.com/elastic/original/3X/d/f/dffce9d0f143ffa96ed6993600bf49d586f4635a.png)

I was trying to add a code like this, but it doesn't work successfully.  
Is there any tips?

```auto
    "x": {
     .
     .
     .
      "scale":{
       "type":"time",
       "domain":[{"hours":0}, {"hours":23}]
}

```

---

<div class="post-metadata">

### Author: ![m-amano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/m-amano/32/62977_2.png) [@m-amano](https://discuss.elastic.co/u/m-amano)
#### Post date: [February 28, 2020, 9:12am UTC](https://discuss.elastic.co/t/how-can-i-set-x-axis-time-domain-with-24hours/221383/2 "2020-02-28T09:12:57Z")

</div>

I finally succeeded to show my graph what I wanted.

This is where I changed my code.

```auto
"domain":[{"hours":0}, {"hours":23}]
↓
"domain":[{"hours":1}, {"hours":24}]

```

 ![sample_bar_20200228_2](https://us1.discourse-cdn.com/elastic/original/3X/a/7/a7166b98dc857ce32e6084ce1ec00f9ef3f25fc9.png)

But the time of 24:00 is not able to show, I guess?

---

<div class="post-metadata">

### Author: ![Elvis\_Saravia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elvis_saravia/32/45624_2.png) [@Elvis\_Saravia](https://discuss.elastic.co/u/Elvis_Saravia)
#### Post date: [February 28, 2020, 9:22am UTC](https://discuss.elastic.co/t/how-can-i-set-x-axis-time-domain-with-24hours/221383/3 "2020-02-28T09:22:15Z")

</div>

Hi @m-amano,

Thanks for sharing the solution. If a question is not directly related to our training material, it may take our group a bit longer to respond. A tip for next time: you can try to post the question in the most relevant group, in this case, I think the Kibana group would have made more sense. Thank you. 🙂

---

<div class="post-metadata">

### Author: ![m-amano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/m-amano/32/62977_2.png) [@m-amano](https://discuss.elastic.co/u/m-amano)
#### Post date: [February 28, 2020, 9:36am UTC](https://discuss.elastic.co/t/how-can-i-set-x-axis-time-domain-with-24hours/221383/4 "2020-02-28T09:36:04Z")

</div>

@Elvis_Saravia  
Thank you for your reply and tips for related group to post this type of question.

I would share my latest code again, because I could show 01:00 to 00:00 on x-axis.

`"format": "%H:%M:%S"` → `"format": "%H:%M"`

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [February 28, 2020, 12:40pm UTC](https://discuss.elastic.co/t/how-can-i-set-x-axis-time-domain-with-24hours/221383/5 "2020-02-28T12:40:21Z")

</div>

I moved the question to #kibana

---

<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 29, 2020, 12:40pm UTC](https://discuss.elastic.co/t/how-can-i-set-x-axis-time-domain-with-24hours/221383/6 "2020-03-29T12:40:22Z")

</div>

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