From a1b48890200c7db0bd0b8cb2a998440c62f3c66c Mon Sep 17 00:00:00 2001 From: cyril59310 Date: Sat, 3 Jan 2026 00:36:48 +0100 Subject: [PATCH] add legend in label --- src/components/PingChart.vue | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/PingChart.vue b/src/components/PingChart.vue index dfe3a7bc1..6306acdd7 100644 --- a/src/components/PingChart.vue +++ b/src/components/PingChart.vue @@ -155,7 +155,8 @@ export default { }, callbacks: { label: (context) => { - return ` ${new Intl.NumberFormat().format(context.parsed.y)} ms`; + const label = context.dataset.label || ''; + return `${label} ${new Intl.NumberFormat().format(context.parsed.y)} ms`; }, } }, @@ -390,7 +391,7 @@ export default { borderColor: "#4ABF74", backgroundColor: "#4ABF7438", yAxisID: "y", - label: this.$t("avgPing") || "Avg Ping", + label: this.$t("avgPing"), }, { // Bar Chart @@ -519,7 +520,7 @@ export default { borderColor: "#126331", backgroundColor: "#2F9C5914", yAxisID: "y", - label: this.$t("minPing") || "Min Ping", + label: this.$t("minPing"), }, { // average ping chart @@ -529,7 +530,7 @@ export default { borderColor: "#5CDD8B", backgroundColor: "#5CDD8B06", yAxisID: "y", - label: this.$t("avgPing") || "Avg Ping", + label: this.$t("avgPing"), }, { // maximum ping chart @@ -539,7 +540,7 @@ export default { borderColor: "#21b55a", backgroundColor: "#1E7A4214", yAxisID: "y", - label: this.$t("maxPing") || "Max Ping", + label: this.$t("maxPing"), }, { // Bar Chart