I've created a view with one parameter (
machineId) and an XY Chart. The XY Chart shows the results tag history binding. It's lovely. This will be the template for all machines with air meters in the plant.
- The chart is using two data sources - Airmeter and Running. These are tag history bindings with the date range selected by the datepicker and date range dropdowns at the top of the view.
- The two tables at the bottom are bound to the XY Chart data sources.
The chart plot area is blank and the Y-axis is missing! Note that the tables are showing the data bindings that the chart is getting.
Further experimentation in the browser reveals that an F5 page refresh will load the chart correctly.
On refresh the chart is loaded correctly.
Can anyone think of an explanation and a fix?
Try a refresh binding on it after you set the values the way you want them. I have encountered race conditions with controls and some kinds of bindings in some circumstances.
I have a project where I had to do a refreshBinding on my data property using an expression historic binding which I think is what you're doing.
I'm trying to find the place where I had to add a python script that did a refresh binding after a short delay.
Hmmm, I wonder if there is any way to delay the first draw until the data has arrived rather than refresh.
Thinking about this some more, I really don't need a binding refresh. The table is showing me that the data has been returned. Instead, I need a chart refresh with the same data.
If you can find your code I'll try it out. Thanks!
I found the script I was thinking of. I was looking in the wrong place. What I did was add a property change script to the "data" property as follows
self.props.xTrace.visible = False
self.props.xTrace.visible = True
This was to resolve a race condition with the timeseries chart where the Y axis was rendering 1 data point behind from the last one I clicked. I got that work around from a post in this forum but I can't find it to link it.
So this is not exactly the same thing as what you're dealing with but it might give you options for fixing the issue you're dealing with. This particular issue is with the timeseries chart.
Figure 3. On initial load the graph and Y-axis are not drawn. On page refresh (F5) they are!
Figure 4. The airmeter binding has a delay. There is a similar one in the run status binding.
What is going on! Why does it work on a refresh but not on the original load? Is the refresh using cached values or what?
The issues raised above have all been fixed in Ignition 8.1.22 RC1.
This has solved
- several issues with the XY Chart not updating properly when the bindings change.
- Date Time Picker now returns midnight rather than midday when used as date picker. This avoids messy code when making a date-range selector for reports, charts, etc.