From c55f3d7bd93343726d1f18817a5319bb605b3d9d Mon Sep 17 00:00:00 2001 From: cyclane Date: Mon, 19 Jul 2021 02:34:55 +0100 Subject: [PATCH] Added legend and fixed tooltip --- .../[profile]/member/[member]/graph/[graph].svelte | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/routes/profile/[profile]/member/[member]/graph/[graph].svelte b/src/routes/profile/[profile]/member/[member]/graph/[graph].svelte index ad508b3..ed9d1ae 100644 --- a/src/routes/profile/[profile]/member/[member]/graph/[graph].svelte +++ b/src/routes/profile/[profile]/member/[member]/graph/[graph].svelte @@ -69,7 +69,11 @@ text: g.data.name }, tooltip: { - trigger: "axis" + trigger: "axis", + order: "valueDesc" + }, + legend: { + show: data[0].length !== 2 || !Array.isArray(data[0][0]) }, xAxis: g.data.x_axis || { name: "Date & time", @@ -79,7 +83,7 @@ type: "value" }, series: - data[0].length === 2 + data[0].length === 2 && !Array.isArray(data[0][0]) ? [ { name: g.data.name,