# Horizontal barchart X-axis - controlling range

**URL:** <https://discuss.elastic.co/t/horizontal-barchart-x-axis-controlling-range/187171>\
**Category:** Kibana\
**Tags:** canvas\
**Created:** [June 24, 2019, 4:32pm UTC](https://discuss.elastic.co/t/horizontal-barchart-x-axis-controlling-range/187171 "2019-06-24T16:32:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gbarnett](https://avatars.discourse-cdn.com/v4/letter/g/ac91a4/32.png) [@gbarnett](https://discuss.elastic.co/u/gbarnett)\
**Post date:** [June 24, 2019, 4:32pm UTC](https://discuss.elastic.co/t/horizontal-barchart-x-axis-controlling-range/187171/1 "2019-06-24T16:32:49Z")

</div>

On the horizontal barchart, I'm using a simple count. For example, the count might range from 0-5. The barchart currently labels the X-axis a 0.0, 0.5, 1.0, 1.5, …

How do I control the x-axis so that it only labels whole numbers (0,1,2,3,4,5) rather than also including the .5 labels?

---

<div class="post-metadata">

**Author:** ![LizaD](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lizad/32/51074_2.png) [@LizaD](https://discuss.elastic.co/u/LizaD)\
**Post date:** [June 24, 2019, 5:37pm UTC](https://discuss.elastic.co/t/horizontal-barchart-x-axis-controlling-range/187171/2 "2019-06-24T17:37:40Z")

</div>

Hi Gary,

Maybe @timroes can help share info if there is a way to do this?

Thanks,  
Liza

---

<div class="post-metadata">

**Author:** ![timroes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timroes/32/19712_2.png) [@timroes](https://discuss.elastic.co/u/timroes)\
**Post date:** [June 27, 2019, 4:27pm UTC](https://discuss.elastic.co/t/horizontal-barchart-x-axis-controlling-range/187171/3 "2019-06-27T16:27:44Z")

</div>

Hi,

that is unfortunately currently not possible. We're trying to implement that in a future version.

Cheers,  
Tim

---

<div class="post-metadata">

**Author:** ![Catherine\_Liu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/catherine_liu/32/34294_2.png) [@Catherine\_Liu](https://discuss.elastic.co/u/Catherine_Liu)\
**Post date:** [June 28, 2019, 9:28pm UTC](https://discuss.elastic.co/t/horizontal-barchart-x-axis-controlling-range/187171/4 "2019-06-28T21:28:18Z")

</div>

Actually setting the axis interval size is available in Canvas only for number axes on `plot` elements which includes the horizontal bar chart.

Here's an example:

Original:  
 ![34%20PM](https://us1.discourse-cdn.com/elastic/original/3X/e/c/ec75ccc02c6bd762872455f663dc3589dd5730c1.png)

With a ticks in 100 intervals:  
 ![14%20PM](https://us1.discourse-cdn.com/elastic/original/3X/c/c/cca8591247accc2934fb516819cc6ddcfc50fa6e.png)

```auto
filters
| demodata
| pointseries x="size(cost)" y="project" color="project"
| plot defaultStyle={seriesStyle bars=0.75 horizontalBars=true} 
   legend=false 
   xaxis={axisConfig tickSize=100} 
| render

```

@gbarnett For you chart, you just need to add a `xaxis={axisConfig tickSize=1}` to your `plot` function.

---

<div class="post-metadata">

**Author:** ![gbarnett](https://avatars.discourse-cdn.com/v4/letter/g/ac91a4/32.png) [@gbarnett](https://discuss.elastic.co/u/gbarnett)\
**Post date:** [July 1, 2019, 10:28am UTC](https://discuss.elastic.co/t/horizontal-barchart-x-axis-controlling-range/187171/5 "2019-07-01T10:28:50Z")

</div>

Catherine, this works great! However, my graph differs from your example in that mine shows one decimal point. For example, 1.0, 2.0, 3.0, etc. In your example, there is no decimal point. Any idea how to suppress this?

---

<div class="post-metadata">

**Author:** ![Catherine\_Liu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/catherine_liu/32/34294_2.png) [@Catherine\_Liu](https://discuss.elastic.co/u/Catherine_Liu)\
**Post date:** [July 3, 2019, 6:20pm UTC](https://discuss.elastic.co/t/horizontal-barchart-x-axis-controlling-range/187171/6 "2019-07-03T18:20:43Z")

</div>

It looks like that's how it's auto formatted by the plot element. There currently isn't a way to change the format of the labels, but there is an issue to add support for custom formatting that you can track here: [https://github.com/elastic/kibana/issues/27926](https://github.com/elastic/kibana/issues/27926).

---

<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 31, 2019, 6:20pm UTC](https://discuss.elastic.co/t/horizontal-barchart-x-axis-controlling-range/187171/7 "2019-07-31T18:20:48Z")

</div>

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