How to add legends in chronograf plots

chronograf

#1

Hi,

How to put legend to the plots in chronograf ?
plot
These are the four queries that are plotted.

SELECT last("voc") AS "last_voc" FROM "sensordata"."autogen"."voc" WHERE time > :dashboardTime: AND "eui"='0015BC0036000018' GROUP BY time(:interval:) FILL(null)

SELECT last("voc") AS "last_voc" FROM "sensordata"."autogen"."voc" WHERE time > :dashboardTime: AND "eui"='0015BC0036000019' GROUP BY time(:interval:) FILL(null)

SELECT last("voc") AS "last_voc" FROM "sensordata"."autogen"."voc" WHERE time > :dashboardTime: AND "eui"='0015BC003600001B' GROUP BY time(:interval:) FILL(null)

SELECT last("voc") AS "last_voc" FROM "sensordata"."autogen"."voc" WHERE time > :dashboardTime: AND "eui"='0015BC0036000016' GROUP BY time(:interval:) FILL(null)

All the four queries look the same, except for the ‘eui’ tag. I explored through the visualization tab but there is only one option to" show static legend" option and its only outputting “last_voc” for all the plots. Is there any way that i can name/legend manually or by using tags ?
Is it possible to represent the plots in different color although the query is same except for tag like in above case?

Thanks


#2

You can add a static legend under the visualization tab.

. In the center column, last row, you should see an option to Hide or Show the Static Legend.


#3

Hi @katy
Thanks for the comment.
What i didn’t realize until you comment , is that
All the queries
SELECT last("voc") AS "last_voc" FROM "sensordata"."autogen"."voc" WHERE time > :dashboardTime: AND "eui"='0015BC0036000018' GROUP BY time(:interval:) FILL(null)

has the same default name “AS last_voc” and this lead to confusion etc. After changing the queries to this

SELECT last("voc") AS "Room_center" FROM "sensordata"."autogen"."voc" WHERE time > :dashboardTime: AND "eui"='0015BC0036000018' GROUP BY time(:interval:) FILL(null)

SELECT last("voc") AS "Room_corner" FROM "sensordata"."autogen"."voc" WHERE time > :dashboardTime: AND "eui"='0015BC0036000019' GROUP BY time(:interval:) FILL(null)

solved the issue.