Added legend and fixed tooltip

This commit is contained in:
Gleb Koval 2021-07-19 02:34:55 +01:00
parent 3ca44334f6
commit c55f3d7bd9
No known key found for this signature in database
GPG Key ID: 120F2F6DA9D995FB
1 changed files with 6 additions and 2 deletions

View File

@ -69,7 +69,11 @@
text: g.data.name text: g.data.name
}, },
tooltip: { tooltip: {
trigger: "axis" trigger: "axis",
order: "valueDesc"
},
legend: {
show: data[0].length !== 2 || !Array.isArray(data[0][0])
}, },
xAxis: g.data.x_axis || { xAxis: g.data.x_axis || {
name: "Date & time", name: "Date & time",
@ -79,7 +83,7 @@
type: "value" type: "value"
}, },
series: series:
data[0].length === 2 data[0].length === 2 && !Array.isArray(data[0][0])
? [ ? [
{ {
name: g.data.name, name: g.data.name,