Real-time charts


In a chart, when using an historical tag and the data range is set to Realtime the time that is used is the one in the client machine. This is a problem, because we have differents timestamps between the server and the clients. So, when the time in the client machine it’s less than the one in the server, we miss data in the chart representation. We are considering use the data range set to historical to avoid this, but it would be very useful if we could use the server timestamp when we using the realtime.

You can still use the Easy Chart but just set the chart mode property to Manual. That way you can bind the start date and end date properties to your own dates. For example, the end date could be bound to:now(5000)which is the current time updating every 5 seconds. If you want to offset it you can use date arithmetic: dateArithmetic(now(5000), -2, "hour")You also need to bind the start date to something like this:dateArithmetic({Root Container.Easy Chart.startDate}, -4, "hour")Try it out and let us know if you have any problems.

By the time you suggested your solution I had implemented a similar one. I’m using the Chart component with a historical tag with data range in historical mode. I have implemented a expression tag that uses the function ‘now()’ to obtain the timestamp of the server (instead of the client). This timestamp is used as the end date and we obtain the start date with the ‘dateArithmetic’ function. there is a more efficient way to do this?. Thanks for your tips.

No, that is a good solution.