gnmyt / myspeed

A speed test analysis software that shows your internet speed for up to 30 days
https://myspeed.dev
MIT License
575 stars 29 forks source link

[Bug] Time axis is not correct on graphs #791

Open ThatIsAPseudo opened 3 weeks ago

ThatIsAPseudo commented 3 weeks ago

General

The Bug

On graphs displaying upload/download speeds and ping, the x-axis indicating time is not correct. On the image below you can see there is the same spacing between ticks of 15:25 and 16:00 (35 min) as there is between 17:00 and 17:19 (19 min) or between 19:00 and 20:00 (60 min).

image

This works well if one uses only the automatic tests without ever changing the delay between tests, however I expect the ticks on the time axis being spaced depending on the exact time elapsed between speed tests.

What device are you using to access the page?

In the browser

Which operating system is your MySpeed instance running on?

Linux

ThatIsAPseudo commented 3 weeks ago

It looks like these files https://github.com/gnmyt/myspeed/blob/development/client/src/pages/Statistics/charts/PingChart.jsx and https://github.com/gnmyt/myspeed/blob/development/client/src/pages/Statistics/charts/SpeedChart.jsx should be modified to specify a type time on the x-axis.

Exemple from chartJS docs :

scales: {
            x: {
                type: 'time',
                time: {
                    unit: 'month'
                }
            }
        }

Source : https://www.chartjs.org/docs/latest/axes/cartesian/time.html