I have chunks of data for each build that I want to visualize with Grafana X-Y chart. Let's say (simplified):
| kpi | average_time | build_id | 
|---|---|---|
| Start App | 150 | 870 | 
| Stop App | 890 | 870 | 
| kpi | average_time | build_id | 
|---|---|---|
| Start App | 140 | 871 | 
| Stop App | 860 | 871 | 
I used PostgreSQL to show lines for each kpi with build_id as X and average_time as Y
SELECT DISTINCT ON (kpi, build_id)
       build_id AS BUILD_ID, 
       average_time AS AVERAGE_TIME
       FROM <MY_TABLE> WHERE kpi IN (${kpi}); 
...and $kpi is a multi-value variable simply returned by SELECT kpi FROM <MY_TABLE>;
When I try to select Start App as single $kpi value it looks OK

but if to select both $kpi values it looks like two lines (that's what I want) but connected with each other (that's not what I want) with extra line

So how to display separate lines for each kpi (with possibility to set a color for each)?

 
    
