I am developing a fleet management system and one of the tasks is to show a chart representing the fuel consumption of the vehicle (based on a data that is coming from the C
Are there ways to determine when fueling/draining are occurring? If so, then you could change your algorithm at those times dynamically.
Otherwise, I would recommend using exponential smoothing.
Let d (0 <= d < 1) be weight factor for previous number. So displayed_number = prev_data*d + new_data*(1-d)
With a proper weight factor, it would seem the "bumpiness" would be removed, yet at the same time the result would reflect fuel events.
This isn't the only option, more of an example algorithm, but I hope you find it useful.
Small edit: I had not realized that exponential smoothing had a proper name. I had merely used the technique when displaying frame rates within games I create. So, thank you Kemper.