# Perspective xy bar chart

**URL:** <https://forum.inductiveautomation.com/t/perspective-xy-bar-chart/75548>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [June 26, 2023, 7:34pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-bar-chart/75548 "2023-06-26T19:34:15Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![dan\_mueller](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@dan\_mueller](https://forum.inductiveautomation.com/u/dan_mueller)\
**Post date:** [June 26, 2023, 7:34pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-bar-chart/75548/1 "2023-06-26T19:34:15Z")

</div>

is there a way to not display the zero value in a series

---

<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:** [June 26, 2023, 7:56pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-bar-chart/75548/2 "2023-06-26T19:56:48Z")

</div>

Yes. Use a script transform on the binding and eliminate them from the data passed to the chart.

[https://docs.inductiveautomation.com/display/DOC81/Script+Transform](https://docs.inductiveautomation.com/display/DOC81/Script+Transform)

---

<div class="post-metadata">

**Author:** ![dan\_mueller](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@dan\_mueller](https://forum.inductiveautomation.com/u/dan_mueller)\
**Post date:** [June 26, 2023, 8:24pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-bar-chart/75548/4 "2023-06-26T20:24:34Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/9/193a78bfa2fe4b0da27b1d041e6b6c4414daf39c.png)

---

<div class="post-metadata">

**Author:** ![dan\_mueller](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@dan\_mueller](https://forum.inductiveautomation.com/u/dan_mueller)\
**Post date:** [June 26, 2023, 8:26pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-bar-chart/75548/5 "2023-06-26T20:26:00Z")

</div>

I have a movable target line that I reset at the beginning of the shift but I don't want to display the zero values

---

<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:** [June 26, 2023, 9:10pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-bar-chart/75548/6 "2023-06-26T21:10:22Z")

</div>

Use the script transform to fill in the target values to the end of shift. I think with the XY Chart you would only need to supply the first and last value. It will then draw a line between the two.

Show us the results of your binding and someone will show you how to transform it. If you're posting code then post the text of the code and format it using the \</\> button.

---

<div class="post-metadata">

**Author:** ![dan\_mueller](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@dan\_mueller](https://forum.inductiveautomation.com/u/dan_mueller)\
**Post date:** [June 27, 2023, 12:38pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-bar-chart/75548/7 "2023-06-27T12:38:42Z")

</div>

Start of shift (second) - zero out hour targets with script  
def valueChanged(tag, tagPath, previousValue, currentValue, initialChange, missedEvents):

```auto
if currentValue.value == 1:
				zero = system.tag.readBlocking(["[.]zero"])[0].value
				system.tag.writeBlocking(["[.]P1_C_Target"], [zero])
				system.tag.writeBlocking(["[.]P2_C_Target"], [zero])
				system.tag.writeBlocking(["[.]P3_C_Target"], [zero])
				system.tag.writeBlocking(["[.]P4_C_Target"], [zero])
				system.tag.writeBlocking(["[.]P5_C_Target"], [zero])
				system.tag.writeBlocking(["[.]P6_C_Target"], [zero])
				system.tag.writeBlocking(["[.]P7_C_Target"], [zero])
				system.tag.writeBlocking(["[.]P8_C_Target"], [zero])
binding to hour data - no transform to not display zero value
![image|612x236](upload://jZn8LQ88Wo6lgsLYGprJ8i7AB91.png)
```

---

<div class="post-metadata">

**Author:** ![dan\_mueller](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@dan\_mueller](https://forum.inductiveautomation.com/u/dan_mueller)\
**Post date:** [June 27, 2023, 12:39pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-bar-chart/75548/8 "2023-06-27T12:39:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dan\_mueller](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@dan\_mueller](https://forum.inductiveautomation.com/u/dan_mueller)\
**Post date:** [June 27, 2023, 1:17pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-bar-chart/75548/9 "2023-06-27T13:17:31Z")

</div>

assign target value for hour:

```auto
	if currentValue.value == 5 or currentValue.value == 13 or currentValue.value == 21:
		zero = system.tag.readBlocking(["[.]zero"])[0].value
		system.tag.writeBlocking(["[.]P1_C_Target"], [zero])
	if currentValue.value == 5 or currentValue.value == 13 or currentValue.value == 21:
			crank_max = system.tag.readBlocking(["[.]Crank_max"])[0].value
			system.tag.writeBlocking(["[.]P1_C_Target"], [crank_max])

```

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [June 28, 2023, 12:59pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-bar-chart/75548/10 "2023-06-28T12:59:36Z")

</div>

You should never individually read or write to tags, always read them in a single function call. It's _significantly_ faster and more efficient  
For example:

```auto
val1, val2 = [qval.value for qval in system.tag.readBlocking(['tag1', 'tag2'])] 

system.tag.writeBlocking(['tag1', 'tag2'], [1,2])

```
