We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8348f53 commit 77562bbCopy full SHA for 77562bb
client/src/pages/Statistics/charts/PingChart.jsx
@@ -18,12 +18,15 @@ const chartOptions = {
18
};
19
20
const SpeedChart = (props) => {
21
+ const testTime = localStorage.getItem("testTime") || 1;
22
const chartData = {
- labels: props.labels,
23
+ labels: testTime < 3 ? props.labels.map((label) => new Date(label).toLocaleTimeString([],
24
+ {hour: "2-digit", minute: "2-digit"})) : props.labels.slice(1).map((label) =>
25
+ new Date(label).toLocaleDateString()),
26
datasets: [
27
{
28
label: t("latest.ping"),
- data: props.data.ping,
29
+ data: testTime < 3 ? props.data.ping : props.data.ping.slice(1),
30
borderColor: '#45C65A',
31
},
32
],
0 commit comments