# Creating X-Bar R-Chart in Perspective

**URL:** <https://forum.inductiveautomation.com/t/creating-x-bar-r-chart-in-perspective/50738>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [September 8, 2021, 7:55pm UTC](https://forum.inductiveautomation.com/t/creating-x-bar-r-chart-in-perspective/50738 "2021-09-08T19:55:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![birgit.fleming](https://avatars.discourse-cdn.com/v4/letter/b/cc9497/32.png) [@birgit.fleming](https://forum.inductiveautomation.com/u/birgit.fleming)\
**Post date:** [September 8, 2021, 7:55pm UTC](https://forum.inductiveautomation.com/t/creating-x-bar-r-chart-in-perspective/50738/1 "2021-09-08T19:55:32Z")

</div>

I’m trying to create a X-Bar R-Chart using the XY Chart in Perspective. Does anybody know how to draw the horizontal lines (control limits)? I’m reading in data from a SQL database and plotting that on the graph, which works fine. Then we have the (user inputted) control limits that are supposed to be displayed on the same chart. Any ideas how to go about this? Thank you!

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [September 9, 2021, 7:02am UTC](https://forum.inductiveautomation.com/t/creating-x-bar-r-chart-in-perspective/50738/2 "2021-09-09T07:02:59Z")

</div>

the horizantal lines are just indicators of the values of the yaxes  
you can change color here:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/2/f2e352223650bebd0c9fbe8c90a4a3f66414e30b.png)  
tho i dont think this is what you want to use to indicate limits, you should just draw a new line for this

(the dotted ones of the outputtemp just happen to mostly underline the ones off the proccestemp)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/5/b5a98d500dcb8968f404fb3d637dc155eb0a1186.png)

---

<div class="post-metadata">

**Author:** ![birgit.fleming](https://avatars.discourse-cdn.com/v4/letter/b/cc9497/32.png) [@birgit.fleming](https://forum.inductiveautomation.com/u/birgit.fleming)\
**Post date:** [September 9, 2021, 2:08pm UTC](https://forum.inductiveautomation.com/t/creating-x-bar-r-chart-in-perspective/50738/3 "2021-09-09T14:08:43Z")

</div>

Thank you for your reply. I’m not trying to format the lines though. I’m trying to add in additional horizontal lines to display the upper and lower control limits.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [September 9, 2021, 2:15pm UTC](https://forum.inductiveautomation.com/t/creating-x-bar-r-chart-in-perspective/50738/4 "2021-09-09T14:15:58Z")

</div>

Not sure if its the easiest methode, but you could add in a upper and lower bound for every data entry in the datasrouce  
and add in an extra series with those values… (so instead of a line going up and down it will just go straight xd)

---

<div class="post-metadata">

**Author:** ![birgit.fleming](https://avatars.discourse-cdn.com/v4/letter/b/cc9497/32.png) [@birgit.fleming](https://forum.inductiveautomation.com/u/birgit.fleming)\
**Post date:** [September 9, 2021, 8:32pm UTC](https://forum.inductiveautomation.com/t/creating-x-bar-r-chart-in-perspective/50738/5 "2021-09-09T20:32:00Z")

</div>

I would have to create a different table for each one of the datasources (we will have several). I was looking into scripting a new dataset (by pulling in a query and then adding in a column with the process values) but haven’t quite figured that out yet.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [September 10, 2021, 6:45am UTC](https://forum.inductiveautomation.com/t/creating-x-bar-r-chart-in-perspective/50738/6 "2021-09-10T06:45:39Z")

</div>

what do you mean with a diffrent table? do you now have a table with multiple datasources in it?  
it would stild be the same, every table just needs to add in an column row for the upper and lower limits

you can use this to add in an extra column to a dataset  
[https://docs.inductiveautomation.com/display/DOC81/system.dataset.addColumn](https://docs.inductiveautomation.com/display/DOC81/system.dataset.addColumn)
