2

I am trying to develop a multi series line graph in grafana with mysql queries.

Here I had two mysql query , but the graphs appear in continuous manner and not in multi series line manner.

Below I pasted the graph. enter image description here

Here the x-axis (months) are repeating and the graph is not overlapping. Kindly suggest for this.

Below I pasted the two queries

Query 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 as metric
FROM `'march'`
where Source='Doors'
group by status
UNION
SELECT
  UNIX_TIMESTAMP(creation_Date) as time_sec,
  count(status) as value,
  month as metric
FROM `'april'`
where Source='Doors'
group by status
UNION
SELECT
  UNIX_TIMESTAMP(creation_Date) as time_sec,
  count(status) as value,
  month as metric
FROM `'may'`
where Source='Doors'
group by status;

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'`
where Source='RTC'
group by status
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) as value,
  month as metric
FROM `'april'`
where Source='RTC'
group by status
UNION
SELECT
  UNIX_TIMESTAMP(creation_Date) as time_sec,
  count(status) as value,
  month as metric
FROM `'may'`
where Source='RTC'
group by status;
ChrisWue
  • 18,612
  • 4
  • 58
  • 83
user28094
  • 41
  • 1
  • 4

1 Answers1

0

currently it does not support multi line graph. Take a look at here. click this link and see the issue

td4u
  • 402
  • 5
  • 17
  • This should be a comment. As the said functionality is not yet supported, the requirement needs to be met in some other way. You need to describe that solution and then refer to online documents as a further read – NitinSingh Jul 19 '18 at 12:20