MySQL Multi value time series (stacked)

I haven’t been able to find any examples or figure out how to create a mysql time series chart with multiple values/metrics to create a stacked bar chart, for example. Is it possible? Can someone provide an example?


just turn on stacking in graph display tab.

and write a query that returns many series:

min(UNIX_TIMESTAMP(time_date_time)) as time_sec,
max(value_double) as value,
metric1 as metric
FROM test_data
WHERE $__timeFilter(time_date_time)
GROUP BY metric1, UNIX_TIMESTAMP(time_date_time) DIV 300
ORDER BY time_sec asc

here metric1 column has many values (one for each series),

This doesn’t seem to work. Can a working example be added to the Grafana Demo portal ( Thanks