Scada-LTS
Scada-LTS copied to clipboard
Fixed problem with chart shifting on the x-axis
Describe the bug Charts with datapoints that have static behaviors, when drawn, do not complete the lines up to the current moment or have an empty beginning. This happens because the graph only connects two points stored in the database and the recording pattern "Record only when the value changes" does not favor variables that are not dynamic, in this case, the user is forced to change to the "Register all data" so that the graph is complete, on the other hand, more information is stored than necessary, which can take a toll on disk space.
Reproduce Steps to reproduce the behavior:
- Go to the Watch List and select some unchanged binary variables
- Click to generate the consolidated graph and you will see the drawing of some graphs ending earlier than others and not having a straight line until the end date of the range.
Expected behavior It is expected that the graph will be drawn from the beginning of the interval to the end regardless of the change.
Screenshots
Desktop (fill in the following information):
- OS: Windows 11
- chrome
- Scada-LTS 2.7.6.1
Additional context I have two suggestions for a solution: 1 - For all datapoints, record every change as an INSERT in the DB but in the next reading that has an equal value, record that same value as a new line in the DB (INSERT) and then every new reading with the same value, just get this second record and make an UPDATE with the time of the last reading. 2 - Suggestion 1 may not be enough for a variable that has no record in the graph range. Therefore, it would also be interesting for all graphs to look for the first record prior to the start of the graph interval and use it as a starting point to draw the graph.
Step 1 could be the first step to resolve another issue which is to show on the graph the interval in which there was no reading, there is a great demand from users for something like "Null" to appear when communication failed, today only the point is connected before and after the lack of communication. I don't want to explore this issue now, but it's good to keep the scenario in mind.