2

我正在尝试使用 mysql 查询在 grafana 中开发多系列折线图。

在这里,我有两个 mysql 查询,但图表以连续方式出现,而不是以多系列线方式出现。

下面我粘贴了图表。 在此处输入图像描述

这里 x 轴(月)重复,图表不重叠。请为此提出建议。

下面我粘贴了两个查询

查询 A:SELECT UNIX_TIMESTAMP(creation_Date) as time_sec, count(status) as value, month as metric FROM 'january' where Source='Doors' group by status UNION SELECT UNIX_TIMESTAMP(creation_Date) as time_sec, count(status) as value, month as metric FROM 'feburary' where Source='Doors' group by status UNION SELECT UNIX_TIMESTAMP(creation_Date) as time_sec, count(status) as value, month 作为指标 FROM 'march' where Source='Doors' group by status UNION SELECT UNIX_TIMESTAMP(creation_Date) as time_sec, count( status) 作为值,月份作为指标 FROM'april' 其中 Source='Doors' 按状态分组 UNION SELECT UNIX_TIMESTAMP(creation_Date) 作为 time_sec,count(status) 作为值,月份作为指标 FROM 'may' where Source='Doors' 按状态分组;

QueryB: SELECT UNIX_TIMESTAMP(creation_Date) as time_sec, count(status) as value, month as metric FROM 'january' where Source='RTC' group by status UNION SELECT UNIX_TIMESTAMP(creation_Date) as time_sec, count(status) as value, month as metric FROM'feburary' 其中 Source='RTC' 按状态分组 UNION SELECT UNIX_TIMESTAMP(creation_Date) as time_sec, count(status) as value, month as metric FROM 'march' where Source='RTC' group by status UNION SELECT UNIX_TIMESTAMP(creation_Date) as time_sec, count(status ) 作为值,月份作为指标 FROM'april' 其中 Source='RTC' 按状态分组 UNION SELECT UNIX_TIMESTAMP(creation_Date) 作为 time_sec,count(status) 作为值,月份作为指标 FROM'may' 其中 Source='RTC' 按状态分组;

4

1 回答 1

0

目前它不支持多线图。看看这里。 单击此链接并查看问题

于 2018-07-19T12:02:07.860 回答