Handling data conversion with trends

This is Ignition Version 8.1.44. Cloud edition

I am investigating changing a project that currently uses Derived tags to handle metric/imperial unit conversions. I’m going to be working on changing it so that it only stores and reads data in a single unit, and any conversion is done at the visualization level. I used Power Charts for trending, but since we will now be saving historical data in only one kind of unit, that no longer appears to be an option for me because there is no way to transform the historical data on the fly if it needs to be converted. Previously the historical data was just being saved in both units. Inefficient, yes, but it made the use of Powercharts viable because I could just bind the datalinks indirectly and point to the metric or imperial datasets.

That leads me to trying to replicate the functionality of Power Charts with Time Series charts instead. Time series charts use a binding that I can run a conversion transform on if the user wants to see the data in metric. So far, I’ve run into a few roadblocks. First, I don’t see how to switch the time series chart between real-time and historical modes. That seems to be a function of the series bindings. But I don’t know if I can change the binding styles with a script or not. If I can, I don’t know how and my searches don’t yield very promising results.

Second, I saw some old threads about keeping the X-Trace on the screen without a mouse hover. I currently have a feature on the Power Charts where there’s a docked view that can be expanded, showing an events table. Tapping on a record in the events table pushes that timestamp to the X-Trace value in the power chart, and I do some other things with the time range to center it. It works great in a power chart, but from what I can tell in a time series chart, the X-trace can only appear on a mouse hover. Like I said, I saw some old threads and a feature request put in, but it doesn’t appear anything ever came of it.

Finally, the Power Chart has an auto-ranging feature that I don’t see in the Time Series chart. Is there a way to do that?

Everything else looks like configuration options that I’d have to build a setup view for in order to make it user-configurable.

I also know there are third party charting components out there. I can suggest them, but if they cost money, it’s not my wallet paying for it, so I’d have to make a case for why they need it.

Ideally if there was some way I could stick with Power Charts and have the data convert dynamically, that would make things a lot easier.

1 Like

Powerchart itself doesn't have any way to do it unfortunately as you already know. The closest hackjob you can do to attempt this is adding a second axis with the new units match the min/max to the correction factor and displaying that.

Which isn't a real solution nor does it fix the x-trace or any of the calculations. So doubt that's worth considering.

I think I figured out how to do this.

I had to create duplicate “Historical” versions of each series. I had 4 before and now I have 8. The difference between the two is the binding on the data property. The existing series data bindings have a realtime binding while the historical series bindings have historical bindings. On each plot trend I have a binding on the Series property tied to a custom property on the view. That will change the series that plot is looking at dynamically.

Since a picture is worth 1000 words, here are my series entries:

Here’s the binding on the Pressure series for example:

And here’s the binding on the Pressure Historical series:

So it’s pointing at the same data, just one binding is real-time, the other is historical.

Then on my Plots properties:

The binding on the series property is as such:

Then all I need to do is change my custom property values, and the chart flips back and forth between historical and realtime.