Modern graph bug?

Eduardo S10 months ago

Hi, good day.

We're experiencing some troubles on fuel graph generation.
While on legacy traccar interface graph is generated correct, in modern interface is being generated out of scale.
Can someone give us a clud about where to search? I think could be the algorithm through maximum and minimum of graph is generated, so we are looking on modern source code to try to fix the issue.

Here are the comparatives about graph of same device, same period of time, but on each web interface :

Legacy :
Graph generated on legacy interface

Modern :
Graph generated on modern interface

Thanks.

Anton Tananaev10 months ago

What version?

Eduardo S10 months ago

Hi anton, thanks for reply.

Server version 5.5, modern app version 5.6.

Tested already on alternative server version 5.6, app version 5.6 with same result.

Anton Tananaev10 months ago

You should try the latest version.

Eduardo S10 months ago

Going to try and post news here.

Thank you.

Eduardo S10 months ago

I've found the issue.
If there's a position in database between date and time range selected that have not the attribute is being graphed, then modern graph doesn't draws correct.

We calculate our "fuel" attribute from the result of some math operations, to convert cilindrical oil tank to liters, but in that calculated attribute, we take NULL if attribute is not calculated. So, by example, when we send a command to the device, it answers with command result, and it's stored in positions, BUT command results doesn't include io attributes. 'Cause that, when we try to graph a period where are command result positions, graph ranges are screwed up. When we delete command result positions, graph is displayed correct.

I think we have two options :
1.- We could replace null in calculated attributes by 0. In that way, all positions will have fuel attribute, even if it is 0. In graph, could be drawed drastic teeths, but graph should be drawed correctly.
2.- Maybe we could use copyAttributes in traccar xml conf to copy last fuel attribute when position doesn't have fuel value? I think that could work too, and shouldn't generate that drastic teeths on graph.

That misreading of positions could be considered as bug? Just a guess.

Thank you, and forgive my bad english please.