Hi all,
I have an issue with a view that contains 3 XY Charts. The operator can enter a roll number that displays 3 parameters, each on its own chart. The screen works beautifully when the 1st number is entered:
After the 2nd roll number is entered, the charts lose their Y-Axis scales and horizontal lines:
I've made multiple attempts to rectify the problem by changing how the data is supplied to the XY Charts with no success.
Any thoughts?
Thanks in advance.
Can you provide any background on how the charts are receiving data? Are there parameters in each chart bound to the value entered into the roll number component, or does the roll number component have an event script associated with it?
I've done it a number of different ways. The first way was to use a named query returning the results for all 3 charts and then using a change script on the query results to populate 3 lists that were then assigned to each chart property:
def valueChanged(self, previousValue, currentValue, origin, missedEvents):
if currentValue.quality.bad:
return
pyd = system.dataset.toPyDataSet(currentValue.value)
if pyd:
for i in range(3):
#spec limits
if i == 0:
lsl = 0
usl = 0
elif i == 1:
lsl = self.view.custom.SpecData.Grammage.LSL
usl = self.view.custom.SpecData.Grammage.USL
elif i == 2:
lsl = self.view.custom.SpecData.LOI.LSL
usl = self.view.custom.SpecData.LOI.USL
lst = []
for j in range(461):
lst.append({"Position": j-230, "Value": pyd[i][j+2]
, "LSL": lsl, "USL": usl})
if i == 0:
self.view.custom.GraphData.Binder = lst
elif i == 1:
self.view.custom.GraphData.Grammage = lst
elif i == 2:
self.view.custom.GraphData.LOI = lst
else:
lst = []
for i in range(461):
lst.append({"Position": i-230, "Value": None,
"LSL": None, "USL": None})
self.view.custom.GraphData.Binder = lst
self.view.custom.GraphData.Grammage = lst
self.view.custom.GraphData.LOI = lst
After that, I tried using 3 separate queries to return the data for each chart directly from the database table. For these first two attempts, I was binding the chart.props.data property to the
self.view.custom.GraphData.Binder, self.view.custom.GraphData.Grammage, self.view.custom.GraphData.LOI custom properties.
The 3rd attempt was to bind the chart.props.data property directly to the queries used in my 2nd attempt. No success for any of the attempts.