Using multiple legends in a single axis

Hi all!

(Input: Elasticsearch)

I am trying to create a bar graph having 2 legends (one at the bottom of the viz and one above the viz; Refer to attached to see the expected result) in the X axis in a single visualization.

The bar graph has a total of 4 fields. One is the date histogram field at the top, second is the tests names at the bottom, and the third is the count shown on the Y axis. The fourth is whether the test failed or passed, indicated by the the colors.

I have tried to implement this in Grafana and am unable to do so. I am using the transformations as below and getting the output as following:

image

Can someone please guide me as to how can I fix this visual and proceed with the expected output? Any advice will be greatly appreciated! :slight_smile: