I am using Apex charts to show data on a line graph and can be updated in real time mode
I am getting data through the named query "Tank1" with no parameters
I have used 2 scripts to gather the last 8 values as integers and it worked but unfortunately it doesn't update as the value changes
It works but unfortunately it doesn't update automatically but when I open the binding and press apply the data is updated but it doesn't update on itself
Below the first transform snippet and a screenshot for the binding
Data = system.db.runNamedQuery("Galvenize/Tank1" )
pyData = system.dataset.toPyDataSet(Data)
newList = []
# step through the rows
for row in pyData:
# create a new blank dictionary for each row of the data
newDict = {}
for i in range(len(row)):
newDict = row[i]
newList.append(newDict)
# Limit the results to last 5
value = newList[-8:]
return value
Bindings update when instantiated (startup), and thereafter when a tag or property they use updates. You are configuring a property binding but have not selected a property to follow. Ergo, no updates.
Consider using a query binding to run your named query, and use the polling option to run it repeatedly. Then your transform will be handed a {value} that is the result dataset--you won't need system.db.runNamedQuery() in the script.
The whole chart changes like in the video. If there is a method to make the old values just disappear without changing the graph. This will give much nicer graph
I have already done that by limiting the set to the last 8 recorded values through the script
The problem is that the graph shape totally changes with each update as shown in the video
Use this in options and also use short time range like man 10 min to make it work. Also, Update every second with Asstored Value. It is important not to use aggregation for this.
Things had become much better
Time on X-Axis is updating and I have changed the format with a script
Animations give me a smooth look but I can't get rid of the snap shot style