datatrails: on histogram breakdowns, show label value in legend (#88154)
fix: on histogram breakdowns, show label value in legend
This commit is contained in:
@@ -68,9 +68,16 @@ function heatMapQuery(groupings: string[] = []): PromQuery {
|
|||||||
function percentileQuery(percentile: number, groupings: string[] = []) {
|
function percentileQuery(percentile: number, groupings: string[] = []) {
|
||||||
const percent = percentile / 100;
|
const percent = percentile / 100;
|
||||||
|
|
||||||
|
let legendFormat = `${percentile}th Percentile`;
|
||||||
|
|
||||||
|
// For the breakdown view, show the label value variable we are grouping by
|
||||||
|
if (groupings[0]) {
|
||||||
|
legendFormat = `{{${groupings[0]}}}`;
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
refId: `Percentile${percentile}`,
|
refId: `Percentile${percentile}`,
|
||||||
expr: `histogram_quantile(${percent}, ${baseQuery(groupings)})`,
|
expr: `histogram_quantile(${percent}, ${baseQuery(groupings)})`,
|
||||||
legendFormat: `${percentile}th Percentile`,
|
legendFormat,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user