I am using echart plugin in Grafana 10.1.0 I am trying to do a Scatter taking data from a MYSQL Query. The MYSQL query is:
SELECT defect_count AS defect_count,d1 AS d1,d2 AS d2 , d3 AS d3,d4 AS d4,d5 AS d5,d6 AS d6,d7 AS d7,d8 AS d8,d9 AS d9,
x1 AS x1,x2 AS x2 , x3 AS x3,x4 AS x4,x5 AS x5,x6 AS x6,x7 AS x7,x8 AS x8,x9 AS x9,
y1 AS y1,y2 AS y2 , y3 AS y3,y4 AS y4,y5 AS y5,y6 AS y6,y7 AS y7,y8 AS y8,y9 AS y9
FROM 401
.defect_map
Order by date_time Desc limit 1;
JSCODE:
let x1 = ;
let y1 = ;
let d1 = ;
let d2 = ;
let d3 = ;
let d4 = ;
let d5 = ;
let d6 = ;
let d7 = ;
let d8 = ;
let d9 = ;
data.series.map((s) => {
x1 = s.fields.find((f) => f.name === “x1”).values.buffer ||
s.fields.find((f) => f.name === “x1”).values;
y1 = s.fields.find((f) => f.name === “y1”).values.buffer ||
s.fields.find((f) => f.name === “y1”).values;
d1 = s.fields.find((f) => f.name === “d1”).values.buffer ||
s.fields.find((f) => f.name === “d1”).values;
d2 = s.fields.find((f) => f.name === “d2”).values.buffer ||
s.fields.find((f) => f.name === “d2”).values;
d3 = s.fields.find((f) => f.name === “d3”).values.buffer ||
s.fields.find((f) => f.name === “d3”).values;
d4 = s.fields.find((f) => f.name === “d4”).values.buffer ||
s.fields.find((f) => f.name === “d4”).values;
d5 = s.fields.find((f) => f.name === “d5”).values.buffer ||
s.fields.find((f) => f.name === “d5”).values;
d6 = s.fields.find((f) => f.name === “d6”).values.buffer ||
s.fields.find((f) => f.name === “d6”).values;
d7 = s.fields.find((f) => f.name === “d7”).values.buffer ||
s.fields.find((f) => f.name === “d7”).values;
d8 = s.fields.find((f) => f.name === “d8”).values.buffer ||
s.fields.find((f) => f.name === “d8”).values;
d9 = s.fields.find((f) => f.name === “d9”).values.buffer ||
s.fields.find((f) => f.name === “d9”).values;
});
I can get x1,y1 ,but i can’t get d1~d9 d1~d9 is string how do map?