I have this query: SELECT time, temp, sensor_id FROM temp_data;
I need to sort my temp and time by sensor_id (like I have 3 sensors with ids 1,2,3) and create multiple lines in Time Series Panel .
I tried another questions in grafana but, its too hard to understand it.
I have a table in Mysql with a field that stores the timestamp, another field with the “device_id” and another field with the value “angle”.
In turn, with a variable, I can select the “device_id” from which I want to display data.
But if I select two or more “device_id” it does not show me a line for each one of them but a line continues to appear.
How can I make a line appear showing the “angle” data of each of the “device_id” that I select?
Thanks
[Screenshot_213]
[Screenshot_214]
Hi,
I do have a mySL/MariDB query giving me several lines with time, a value and the name of the line.
here: Multiple lines in one graph with only one query
I found, that I have to name them time, metric and value to get several lines.
But it does simply not work. They all are mixed together as if the metrics coloum is not present.
Can someone help me please out, what I am missing.
This is my querry:
SELECT
(UNIX_TIMESTAMP(timeinfo)) AS time,
name as metric,
w as value
FROM table1
WH…
I use grafana in docker container!
what version of grafana and what is your datasource? mysql? influxdb?
SELECT time, temp as value, sensor_id as metric
FROM temp_data
then make sure you choose Time Series as Format
in grafana ui
Hello I use mysql database, here is example of data:
id |temp |time |sensor_id|
—±----±------------------±--------+
1|28.13|2024-08-29 17:49:56| 1|
2|28.06|2024-08-29 17:49:56| 2|
3|28.25|2024-08-29 17:49:57| 3|
4|28.13|2024-08-29 17:49:58| 1|
5|28.06|2024-08-29 17:49:58| 2|
6|28.31|2024-08-29 17:49:59| 3|
7|28.19|2024-08-29 17:50:00| 1|
8|28.06|2024-08-29 17:50:00| 2|
9|28.31|2024-08-29 17:50:01| 3|
you need to make it varchar
CONCAT("", sensor_id)
or some other means, otherwise time series wont like it.
1 Like