# Aggregation Based Line Chart - Y axis is inverted

**URL:** <https://discuss.elastic.co/t/aggregation-based-line-chart-y-axis-is-inverted/321907>\
**Category:** Kibana\
**Created:** [December 23, 2022, 11:04am UTC](https://discuss.elastic.co/t/aggregation-based-line-chart-y-axis-is-inverted/321907 "2022-12-23T11:04:00Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![tinrik](https://avatars.discourse-cdn.com/v4/letter/t/d78d45/32.png) [@tinrik](https://discuss.elastic.co/u/tinrik)\
**Post date:** [December 23, 2022, 11:04am UTC](https://discuss.elastic.co/t/aggregation-based-line-chart-y-axis-is-inverted/321907/1 "2022-12-23T11:04:00Z")

</div>

Hi,

I am running Kibana 7.16.1. I currently have an Aggregation-based Line Chart that works as intended:

 ![Screenshot from 2022-12-23 12-01-07](https://us1.discourse-cdn.com/elastic/original/3X/3/5/354c5a53b5fcc41c3cb9afed981f11f94eea1b98.png)

Now I have created a copy by clicking on "Clone", and simply changed the field of the Split Series to split by a different field in my dataset. Currently there's only 1 unique field so only one line displayed. The problem however is that the Y-axis is inverted!

 ![Screenshot from 2022-12-23 12-00-41](https://us1.discourse-cdn.com/elastic/original/3X/5/d/5d00e84e81fea31047d992039aa1dcf8641fc2c7.png)

This is very unexpected since I cloned the original panel, thus all panel settings should be identical. Do you have any feeling for what might be happening? How can I tell Kibana to invert the Y axis?

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:** [December 23, 2022, 11:28am UTC](https://discuss.elastic.co/t/aggregation-based-line-chart-y-axis-is-inverted/321907/2 "2022-12-23T11:28:41Z")

</div>

This is super weird. No we don't 🤔  
Can you share with me with screenshots the configuration of the chart? Also if you create it from scratch do you see the axis inverted or correct?

---

<div class="post-metadata">

**Author:** ![tinrik](https://avatars.discourse-cdn.com/v4/letter/t/d78d45/32.png) [@tinrik](https://discuss.elastic.co/u/tinrik)\
**Post date:** [December 23, 2022, 11:47am UTC](https://discuss.elastic.co/t/aggregation-based-line-chart-y-axis-is-inverted/321907/3 "2022-12-23T11:47:01Z")

</div>

Sure thing! Here come some screenshots of the Split Series and the Y-axis configuration, let me know if I missed something.

![Screenshot from 2022-12-23 12-43-25](https://us1.discourse-cdn.com/elastic/original/3X/e/4/e472c7723bccd15a70836473beb4994c2aef6979.png)

 ![Screenshot from 2022-12-23 12-43-51](https://us1.discourse-cdn.com/elastic/original/3X/9/b/9bbdcb09a26dba29f8e10bd1ff6ea988bd00c89e.png)

![Screenshot from 2022-12-23 12-43-59](https://us1.discourse-cdn.com/elastic/original/3X/7/d/7d8d461df278ac114d1c26bd3eda1a5d2e659bb5.png)

I also notice that the problem is fixed is I remove the "Scale to data bounds" option. My goal is still to have a range of "data range +- 1000" with the correct Y axis orientation.

Yes I actually started creating the chart from scratch, then when I noticed it had the Y axis inverted I tried making a clone of the one that was fine.

---

<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:** [December 23, 2022, 11:55am UTC](https://discuss.elastic.co/t/aggregation-based-line-chart-y-axis-is-inverted/321907/4 "2022-12-23T11:55:55Z")

</div>

Thanx, except from the split series what else do you have in the chart? If I can understand correctly is a date histogram on the x -axis and the metric? What aggregation are you using?

---

<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:** [December 23, 2022, 12:00pm UTC](https://discuss.elastic.co/t/aggregation-based-line-chart-y-axis-is-inverted/321907/5 "2022-12-23T12:00:32Z")

</div>

Also what type is the field that you are using as a metric? This could also help because I can't replicate it tbh.

Finally, can you try to create this in Lens? Does the problem exist there?

---

<div class="post-metadata">

**Author:** ![tinrik](https://avatars.discourse-cdn.com/v4/letter/t/d78d45/32.png) [@tinrik](https://discuss.elastic.co/u/tinrik)\
**Post date:** [December 23, 2022, 1:10pm UTC](https://discuss.elastic.co/t/aggregation-based-line-chart-y-axis-is-inverted/321907/6 "2022-12-23T13:10:41Z")

</div>

Yes exactly, date histogram on x-axis and one metric (Sum of violations).

The field I'm using "violations" is just an integer.

I can't replicate it in Lens because it doesn't allow me to choose a range for the Y axis being "Data bounds **+- margin**". If I choose "Full range" I get the same behavior as with the Aggregation Based Line Chart.

If I add a new datapoint that makes the line no longer be horizontal (either it goes up or down) then the Y axis gets the correct orientation.

So perhaps it's just a silly edge case? 🙂

---

<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:** [December 23, 2022, 1:15pm UTC](https://discuss.elastic.co/t/aggregation-based-line-chart-y-axis-is-inverted/321907/7 "2022-12-23T13:15:19Z")

</div>

Yes very possible. I will share it with the team, they might have more insights for this case. Thanx for reporting this!

---

<div class="post-metadata">

**Author:** ![markov00](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/markov00/32/33316_2.png) [@markov00](https://discuss.elastic.co/u/markov00)\
**Post date:** [December 23, 2022, 4:33pm UTC](https://discuss.elastic.co/t/aggregation-based-line-chart-y-axis-is-inverted/321907/8 "2022-12-23T16:33:53Z")

</div>

@tinrik could you check what does it happen if you reduce the bounds? to 100, 10, 1  
Do all 4 data points have the same value?

---

<div class="post-metadata">

**Author:** ![tinrik](https://avatars.discourse-cdn.com/v4/letter/t/d78d45/32.png) [@tinrik](https://discuss.elastic.co/u/tinrik)\
**Post date:** [December 23, 2022, 5:46pm UTC](https://discuss.elastic.co/t/aggregation-based-line-chart-y-axis-is-inverted/321907/9 "2022-12-23T17:46:54Z")

</div>

@markov00 Same behavior, just different range in the Y axis (but still inverted). Yes, all 4 data points have the same value. As soon as one of them is different then the Y axis works as expected.

It gets even funnier if you set the type to "Area" instead of "Line", then the area is drawn from the line up 🙂

 ![Screenshot from 2022-12-23 18-46-07](https://us1.discourse-cdn.com/elastic/original/3X/4/4/4437e33e24deed955ed6f9877a1e60e4b14872dc.png)

---

<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:** [January 20, 2023, 5:47pm UTC](https://discuss.elastic.co/t/aggregation-based-line-chart-y-axis-is-inverted/321907/10 "2023-01-20T17:47:26Z")

</div>

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