# Perspective XY Bar Chart Questions

**URL:** <https://forum.inductiveautomation.com/t/perspective-xy-bar-chart-questions/61942>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [July 15, 2022, 12:52pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-bar-chart-questions/61942 "2022-07-15T12:52:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [July 15, 2022, 12:52pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-bar-chart-questions/61942/1 "2022-07-15T12:52:58Z")

</div>

I’ve got a project where a customer would like some KPI widgets and one of their desires is a bar chart.

I can get a bar chart working in the XY Chart for Perspective however I’d like to be able to do some things with the chart that I just can’t seem to get done.

For instance, I have this generic chart:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/9/2928c87a2f3c61337c46b66d96a6931bfa7242d4.png)

Is there a way to have each of the products or X axis be a different color? And then is there a way to have the legend reflect those colors?

I was able to get the label/value above each of the bars by generating a new series and tweaking the bullets. Is there a way to style that label other than what is in the props tree?

This is what they gave me as an example and I’m trying to get as close to this example:

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

Any ideas?

---

<div class="post-metadata">

**Author:** ![djs](https://avatars.discourse-cdn.com/v4/letter/d/e47774/32.png) [@djs](https://forum.inductiveautomation.com/u/djs)\
**Post date:** [July 15, 2022, 1:43pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-bar-chart-questions/61942/2 "2022-07-15T13:43:07Z")

</div>

In your series, under `column/appearance/fill/color` you can specify the color that you want. As long as “ProductA” and “ProductB” are 2 separate datasources + series, your legend should reflect the names and colors of the bars.

If you want to do it with one datasource + series, you can add a ‘color’ prop to your data and then use `appearance/deriveFieldsFromData/fill/color` and specify the key that you used. However the legend will just have the name of your series and won’t match the color…

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [July 15, 2022, 2:15pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-bar-chart-questions/61942/3 "2022-07-15T14:15:24Z")

</div>

Thanks!

I’m not sure if the legend part is needed for sure, just trying to mimic. I do like your second idea though. I’ll have to play around with that.

---

<div class="post-metadata">

**Author:** ![Vatsal\_Shah](https://avatars.discourse-cdn.com/v4/letter/v/0ea827/32.png) [@Vatsal\_Shah](https://forum.inductiveautomation.com/u/Vatsal_Shah)\
**Post date:** [July 11, 2023, 12:39pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-bar-chart-questions/61942/4 "2023-07-11T12:39:12Z")

</div>

@bschroeder can you share the screen shot of the  
 ![temp2](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/e/ced9de9fcf47f9eedb96812dbad96d85bea28af9.png)  
Property perspective editor (full json data of this would be appreciated) for how you managed to tweak the attached image

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [August 31, 2023, 2:15pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-bar-chart-questions/61942/5 "2023-08-31T14:15:07Z")

</div>

We ended up not going the route of coloring the bar chart. There was more work required to do that than just to label them underneath the bar.
