We have a graph that shows bandwidth usage over time. The bandwidth is returned from the server in bytes.
We need to decide which units to show in the graph in case there are several different bandwidth points.
The data is received from the server like that:
[10000,200,3150,150,25900,193] // In bytes
The client shows this data in a list and in a graph.
In the list - convert it to KB/MB/GB based on the amount of bytes
In the graph - Get the highest point in bytes (25900), if it's higher than X show in KB, higher than Y shows in MB, etc...
The question -
Where is the right place to calculate the which units to show in the graph - in the frontend or backend rest API?
The calculation need to be made once and the user has no option to change those units.