Perspective xy bar chart

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

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

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

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.

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

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)

image

assign target value for hour:

	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])

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:

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

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