# Stacked bar chart from dataset

**URL:** <https://forum.inductiveautomation.com/t/stacked-bar-chart-from-dataset/62841>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [August 9, 2022, 6:15pm UTC](https://forum.inductiveautomation.com/t/stacked-bar-chart-from-dataset/62841 "2022-08-09T18:15:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fanselm](https://avatars.discourse-cdn.com/v4/letter/f/47e85d/32.png) [@fanselm](https://forum.inductiveautomation.com/u/fanselm)\
**Post date:** [August 9, 2022, 6:15pm UTC](https://forum.inductiveautomation.com/t/stacked-bar-chart-from-dataset/62841/1 "2022-08-09T18:15:13Z")

</div>

Hi all,

I’d like to display the following dataset using an XYChart as a stacked bar chart:

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

I’m having issues figuring out how to configure the XYChart.

Column WMS\_CUTOFF should be x-axis,  
y-axis would be the stacked ORDER\_STATE with AMOUNT.

New to this and wasn’t able to find an exact manual.

Thanks!

---

<div class="post-metadata">

**Author:** ![Samg23](https://avatars.discourse-cdn.com/v4/letter/s/df788c/32.png) [@Samg23](https://forum.inductiveautomation.com/u/Samg23)\
**Post date:** [August 9, 2022, 6:37pm UTC](https://forum.inductiveautomation.com/t/stacked-bar-chart-from-dataset/62841/2 "2022-08-09T18:37:06Z")

</div>

This should send you in the right direction.

> [@Stacked Bar Chart in Perspective - Detailed Steps](https://forum.inductiveautomation.com/t/stacked-bar-chart-in-perspective-detailed-steps/47107):
>
> Few months ago I needed to create a stacked bar chart and ran into issues ([Perspective 8.0.14 Time Series Bar Chart width - #3 by arun1](http://forum.inductiveautomation.com/t/perspective-8-0-14-time-series-bar-chart-width/37160/3)). There are few posts here but they don’t give a full picture. Here are the steps that I took to create one: First it is worthwhile to note that we need to use the XY chart and not the TimeSeries chart because the width of the bar chart is calculated automatically based on the amount of data in the x-axis so if you have sparse data in a wide time range then th…

---

<div class="post-metadata">

**Author:** ![fanselm](https://avatars.discourse-cdn.com/v4/letter/f/47e85d/32.png) [@fanselm](https://forum.inductiveautomation.com/u/fanselm)\
**Post date:** [August 12, 2022, 10:00am UTC](https://forum.inductiveautomation.com/t/stacked-bar-chart-from-dataset/62841/3 "2022-08-12T10:00:21Z")

</div>

Thanks - that helped me a ton!  
Just needed to edit my query so I pivot every state in its own column.

Thanks 🙂
