# Xychart stacked bar not functioning

**URL:** <https://forum.inductiveautomation.com/t/xychart-stacked-bar-not-functioning/72061>\
**Category:** Ignition\
**Created:** [April 5, 2023, 12:26am UTC](https://forum.inductiveautomation.com/t/xychart-stacked-bar-not-functioning/72061 "2023-04-05T00:26:19Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![chaoliang](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@chaoliang](https://forum.inductiveautomation.com/u/chaoliang)\
**Post date:** [April 5, 2023, 12:26am UTC](https://forum.inductiveautomation.com/t/xychart-stacked-bar-not-functioning/72061/1 "2023-04-05T00:26:19Z")

</div>

Somehow the stacked bar function is not working as expected.

I am using Ignition V8.1.26

1. create a new xychart with default values.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/c/dcb74727190804cc56d75fc1c1bd8ee7f9d92fe6.png)
2. change the both value display to column.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/c/bccdc46a0ad1e5eddbd4f8761a65e079312a8720.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/8/b8a5ac55fcd5a2a0bcbfa822235517f663c31905.png)
3. both column selected "Stacked"  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/9/d9bc5d0a4f3f71f6ccd1e7aa2556c861601cb256.png)
4. the display is like this, only the bar height is increased, not stacked.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/2/629515497a6272a772b564be3a4e710264acd842.png)

---

<div class="post-metadata">

**Author:** ![schenk](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@schenk](https://forum.inductiveautomation.com/u/schenk)\
**Post date:** [April 5, 2023, 1:26pm UTC](https://forum.inductiveautomation.com/t/xychart-stacked-bar-not-functioning/72061/2 "2023-04-05T13:26:42Z")

</div>

Both series need to be on the same y-axis. If you change `series[0].yAxis` to `output temp`, it will stack as expected

---

<div class="post-metadata">

**Author:** ![chaoliang](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@chaoliang](https://forum.inductiveautomation.com/u/chaoliang)\
**Post date:** [April 6, 2023, 12:12am UTC](https://forum.inductiveautomation.com/t/xychart-stacked-bar-not-functioning/72061/3 "2023-04-06T00:12:23Z")

</div>

Thank you.

It resolved the issue.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/7/7759ad4da19d301e4c139e7ac2b96ff397541a62.png)

I am looking for the other kind of stacked bar.  
The current stacked bar is one above the other, I am looking for the one behind the other, so I can see the difference.

Is it possible?

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 6, 2023, 5:59am UTC](https://forum.inductiveautomation.com/t/xychart-stacked-bar-not-functioning/72061/4 "2023-04-06T05:59:46Z")

</div>

> [@chaoliang](#):
>
> I am looking for the one behind the other

That's not a stacked bar then. I don't know what you _would_ call it and I'm not sure what use it would be if it looks like a stack and when the front bar obscures the rear bar. Where have you seen these used?

If you introduce a third, empty series or series of zero values you should be able to introduce a gap between each pair of side by side values. That should make it clearer for value comparison.

---

<div class="post-metadata">

**Author:** ![chaoliang](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@chaoliang](https://forum.inductiveautomation.com/u/chaoliang)\
**Post date:** [April 6, 2023, 9:51am UTC](https://forum.inductiveautomation.com/t/xychart-stacked-bar-not-functioning/72061/5 "2023-04-06T09:51:26Z")

</div>

It will be used to check:

1. what's the setpoint
2. what's the feedback
3. what's the error

I used a PI tool which can achieve this function.

If it is not possible to create it in Ignition, I can set the two values side by side, similar deal.

Thanks for the comments.

---

<div class="post-metadata">

**Author:** ![schenk](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@schenk](https://forum.inductiveautomation.com/u/schenk)\
**Post date:** [April 6, 2023, 10:18am UTC](https://forum.inductiveautomation.com/t/xychart-stacked-bar-not-functioning/72061/6 "2023-04-06T10:18:22Z")

</div>

> [@chaoliang](#):
>
> I am looking for the one behind the other

That is called a Layered Column Chart in [Amcharts](https://www.amcharts.com/demos/layered-column-chart/).  
You can acheive that by adding the clustered key and setting it to false on both series - series[0].clustered

You can also set series[1].column.appearance.width and series[1].zIndex to 1 to bring it to the front

---

<div class="post-metadata">

**Author:** ![chaoliang](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@chaoliang](https://forum.inductiveautomation.com/u/chaoliang)\
**Post date:** [April 6, 2023, 12:30pm UTC](https://forum.inductiveautomation.com/t/xychart-stacked-bar-not-functioning/72061/7 "2023-04-06T12:30:32Z")

</div>

Just did it.

Thank you for the advise.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/8/788734287b44a925ab21408253868329cd9acb73.png)

one more question:  
you can see from the above picture that the x axis lists even number only.  
What's the setting that can allows me to specify the x axis marker? I want to display all numbers (from 0 to 45).

---

<div class="post-metadata">

**Author:** ![schenk](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@schenk](https://forum.inductiveautomation.com/u/schenk)\
**Post date:** [April 6, 2023, 1:03pm UTC](https://forum.inductiveautomation.com/t/xychart-stacked-bar-not-functioning/72061/8 "2023-04-06T13:03:14Z")

</div>

Try lowering the value of `xAxis[0].appearance.grid.minDistance`

---

<div class="post-metadata">

**Author:** ![chaoliang](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@chaoliang](https://forum.inductiveautomation.com/u/chaoliang)\
**Post date:** [April 6, 2023, 2:26pm UTC](https://forum.inductiveautomation.com/t/xychart-stacked-bar-not-functioning/72061/9 "2023-04-06T14:26:18Z")

</div>

It works.

BTW, where can I find these kind of information?  
Is there any user manual listing the details of all of the properties?  
So far I am just wild guessing and trying every setting to see how it works.

---

<div class="post-metadata">

**Author:** ![schenk](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@schenk](https://forum.inductiveautomation.com/u/schenk)\
**Post date:** [April 6, 2023, 5:11pm UTC](https://forum.inductiveautomation.com/t/xychart-stacked-bar-not-functioning/72061/10 "2023-04-06T17:11:50Z")

</div>

I've been able to find most info I need by digging through the docs here https://www.amcharts.com/docs/v4
