# Duplicate Y-Axis value on number

**URL:** https://discuss.elastic.co/t/duplicate-y-axis-value-on-number/281790
**Category:** Kibana
**Created:** [August 18, 2021, 8:21am UTC](https://discuss.elastic.co/t/duplicate-y-axis-value-on-number/281790 "2021-08-18T08:21:19Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![Celiken](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/celiken/32/72745_2.png) [@Celiken](https://discuss.elastic.co/u/Celiken)
#### Post date: [August 18, 2021, 8:21am UTC](https://discuss.elastic.co/t/duplicate-y-axis-value-on-number/281790/1 "2021-08-18T08:21:19Z")

</div>

Hi,

I'm trying to create a vertical bar visualizations, but since the Y-axis range isn't big, it creates some weird things.  
I want to visualize the max value of invalidBatteryCount over time, this value can be in the range [0;15]  
This is what I get by default:

 ![v1](https://us1.discourse-cdn.com/elastic/original/3X/3/3/3302f3d5eddb9f4d5243211aaf982cf16cdd1f9c.png)  
You can see on the Y-axis, I have duplicate for each value.

I manage to remove duplicate by activating the "filter labels" options, but then the labels/grid is not aligned with the vertical bar:

 ![v2](https://us1.discourse-cdn.com/elastic/original/3X/f/1/f18c8c845aecc6d5a91247f5f5a7e7f74040b403.png)

By playing with the custom extents, I saw that starting at a range of [0;8], the Y-axis stop having weird behaviour:

 ![v3](https://us1.discourse-cdn.com/elastic/original/3X/3/9/3901fc591dd832a5a523c60976dc7754e307070f.png)  
 ![v4](https://us1.discourse-cdn.com/elastic/original/3X/e/2/e2ff95ae1352084307ba35f26d5dd2b935b389ba.png)

Is there a way to have that same behaviour, without having to change the data bounds manually? And so having it automatically change to the max value in the period selected?

Thanks 🙂

---

<div class="post-metadata">

### Author: ![Stratoula\_Kalafateli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stratoula_kalafateli/32/70923_2.png) [@Stratoula\_Kalafateli](https://discuss.elastic.co/u/Stratoula_Kalafateli)
#### Post date: [August 19, 2021, 8:04am UTC](https://discuss.elastic.co/t/duplicate-y-axis-value-on-number/281790/2 "2021-08-19T08:04:52Z")

</div>

Hey! Which kibana version do you use? I want to try replicating it. Also can you also share with me the configuration of your data tab?

---

<div class="post-metadata">

### Author: ![Celiken](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/celiken/32/72745_2.png) [@Celiken](https://discuss.elastic.co/u/Celiken)
#### Post date: [August 19, 2021, 8:38am UTC](https://discuss.elastic.co/t/duplicate-y-axis-value-on-number/281790/3 "2021-08-19T08:38:03Z")

</div>

Hello,

We're currently on the v7.13.4

For the data, it's just a really basic vertical bar:  
Y-Axis: "Max" Aggregation on any field (with value low enough to reproduce)  
X-Axis: Date Histogram  
I also have a split series on X in "normal" mode (no stack), but the problem is present without this split too.

 ![Capture d’écran 2021-08-19 103544](https://us1.discourse-cdn.com/elastic/original/3X/4/d/4d66a5b5dcbd00983e0d4a5ac4b9a690e68c8fac.png)  
This will reproduce the first version of visualization I linked (without the filter label option).  
From there you can reproduce the 3 other by doing the same thing I described in the original post.

---

<div class="post-metadata">

### Author: ![Stratoula\_Kalafateli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stratoula_kalafateli/32/70923_2.png) [@Stratoula\_Kalafateli](https://discuss.elastic.co/u/Stratoula_Kalafateli)
#### Post date: [August 19, 2021, 8:52am UTC](https://discuss.elastic.co/t/duplicate-y-axis-value-on-number/281790/4 "2021-08-19T08:52:58Z")

</div>

Hmmm interesting I can't reproduce it. Why type is the `invalidBatterycount`. Moreover if you go to advanced settings and switch on this setting

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/7/477f1ac4fec95bf9c425ce997d19b9c0f21c28c8.png)

is it still happening?

---

<div class="post-metadata">

### Author: ![Celiken](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/celiken/32/72745_2.png) [@Celiken](https://discuss.elastic.co/u/Celiken)
#### Post date: [August 19, 2021, 9:03am UTC](https://discuss.elastic.co/t/duplicate-y-axis-value-on-number/281790/5 "2021-08-19T09:03:15Z")

</div>

I tried enabling the options but the problems remains.  
However I saw the `invalidBatteryCount` has been set to a `long`, actually like every other numbers value, when they all should be `integer`, this is probably what's creating this behaviour. Is there a way to change the mapping of an index to update the type of fields?

---

<div class="post-metadata">

### Author: ![Celiken](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/celiken/32/72745_2.png) [@Celiken](https://discuss.elastic.co/u/Celiken)
#### Post date: [August 19, 2021, 9:19am UTC](https://discuss.elastic.co/t/duplicate-y-axis-value-on-number/281790/6 "2021-08-19T09:19:20Z")

</div>

I just tried importing some data in our test server, and changing the mapping from long to integer, but the problem persist.

 ![Capture d’écran 2021-08-19 111750](https://us1.discourse-cdn.com/elastic/original/3X/4/a/4a6c30a391feca9cea2af55f2287787fb198e0d2.png)

---

<div class="post-metadata">

### Author: ![Stratoula\_Kalafateli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stratoula_kalafateli/32/70923_2.png) [@Stratoula\_Kalafateli](https://discuss.elastic.co/u/Stratoula_Kalafateli)
#### Post date: [August 19, 2021, 9:49am UTC](https://discuss.elastic.co/t/duplicate-y-axis-value-on-number/281790/7 "2021-08-19T09:49:40Z")

</div>

Can you create a sample dataset and send it to me ?  
Have you tried the above setting that I sent you? Moreover, do you also replicate it with Lens?

---

<div class="post-metadata">

### Author: ![Celiken](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/celiken/32/72745_2.png) [@Celiken](https://discuss.elastic.co/u/Celiken)
#### Post date: [August 19, 2021, 9:58am UTC](https://discuss.elastic.co/t/duplicate-y-axis-value-on-number/281790/8 "2021-08-19T09:58:05Z")

</div>

You can try with this sample:

```auto
timestamp;playerID;invalidBatteryCount
2021-05-18T17:16:32+02:00;0;2
2021-05-18T16:09:47+02:00;0;2
2021-05-15T19:06:34+02:00;3;2
2021-05-15T16:40:08+02:00;0;2
2021-05-14T22:04:07+02:00;3;2
2021-05-14T16:50:49+02:00;0;2
2021-05-13T21:10:27+02:00;2;0
2021-05-13T18:59:29+02:00;0;2
2021-05-13T17:32:21+02:00;0;2
2021-05-13T13:50:24+02:00;0;2
2021-05-12T19:06:55+02:00;0;2
2021-05-12T15:30:55+02:00;3;1
2021-05-08T21:44:29+02:00;0;2
2021-05-08T19:06:03+02:00;1;2
2021-05-08T16:34:11+02:00;1;2
2021-05-07T21:38:45+02:00;2;0
2021-05-07T21:11:15+02:00;3;1

```

That sample give me a result that looks like this

 ![Capture d’écran 2021-08-19 115346](https://us1.discourse-cdn.com/elastic/original/3X/2/c/2c52717410795939e7af8d2a18c1ab54f2a88d79.png)

The legacy chart options did not fixed it, but it does change something, since the `filter labels`  
options doesn't remove duplicate anymore.

Creating the visualization from the Lens doesn't create duplicate but fail to align of grid/value:

 ![Capture d’écran 2021-08-19 115631](https://us1.discourse-cdn.com/elastic/original/3X/0/2/02510be3683710de286c8e550eae6e0a635aa9a3.png)

---

<div class="post-metadata">

### Author: ![Stratoula\_Kalafateli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stratoula_kalafateli/32/70923_2.png) [@Stratoula\_Kalafateli](https://discuss.elastic.co/u/Stratoula_Kalafateli)
#### Post date: [August 19, 2021, 10:34am UTC](https://discuss.elastic.co/t/duplicate-y-axis-value-on-number/281790/9 "2021-08-19T10:34:03Z")

</div>

Ok I am on a 7.13.4 instance. I ingested your sample data that they were mapped as:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/a/5a68610c4d5a430d2bb743137a5767450a0ce2fc.png)  
Here id --\> playerId  
and to\_max --\> invalidBatterCount

I create a new vertical bar with your settings (or at least this is what I think)  
and the result is correct

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/1/c17857c2a527babdd1f2749264c3ba1bdab91e07.png)

---

<div class="post-metadata">

### Author: ![Stratoula\_Kalafateli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stratoula_kalafateli/32/70923_2.png) [@Stratoula\_Kalafateli](https://discuss.elastic.co/u/Stratoula_Kalafateli)
#### Post date: [August 19, 2021, 10:36am UTC](https://discuss.elastic.co/t/duplicate-y-axis-value-on-number/281790/10 "2021-08-19T10:36:36Z")

</div>

So my question is. Have you changed this advanced setting?

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/1/e19ce50086065963dc4bb032e5f74b37243e4e11.png)

---

<div class="post-metadata">

### Author: ![Celiken](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/celiken/32/72745_2.png) [@Celiken](https://discuss.elastic.co/u/Celiken)
#### Post date: [August 19, 2021, 11:38am UTC](https://discuss.elastic.co/t/duplicate-y-axis-value-on-number/281790/11 "2021-08-19T11:38:10Z")

</div>

Ah... I indeed changed that format to `0,0`.  
That fix it the y-axis, however... is it a normal behaviour to have labels/grid for these decimal values when the field you're counting is an integer? 🤔

---

<div class="post-metadata">

### Author: ![Stratoula\_Kalafateli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stratoula_kalafateli/32/70923_2.png) [@Stratoula\_Kalafateli](https://discuss.elastic.co/u/Stratoula_Kalafateli)
#### Post date: [August 19, 2021, 11:45am UTC](https://discuss.elastic.co/t/duplicate-y-axis-value-on-number/281790/12 "2021-08-19T11:45:57Z")

</div>

It has to do with how ES returns the max aggregation. If you run

```auto
POST /my_index/_search?size=0
{
  "aggs": {
    "max_price": { "max": { "field": "to_max" } }
  }
}

```

the response is:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/4/f423230f25a17e68fd21a25e7a30ee0691e431c0.png)

---

<div class="post-metadata">

### Author: ![Celiken](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/celiken/32/72745_2.png) [@Celiken](https://discuss.elastic.co/u/Celiken)
#### Post date: [August 19, 2021, 11:51am UTC](https://discuss.elastic.co/t/duplicate-y-axis-value-on-number/281790/13 "2021-08-19T11:51:18Z")

</div>

Indeed, seems like `min` and `max` force it to double...

---

<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: [September 16, 2021, 11:52am UTC](https://discuss.elastic.co/t/duplicate-y-axis-value-on-number/281790/14 "2021-09-16T11:52:17Z")

</div>

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