mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
BarChart: Fix legend for fields with labels (#71098)
This commit is contained in:
parent
daf9f9cd19
commit
901495a54a
@ -475,7 +475,12 @@ export function prepareBarChartDisplayValues(
|
|||||||
let legendFields: Field[] = fields;
|
let legendFields: Field[] = fields;
|
||||||
if (options.stacking === StackingMode.Percent) {
|
if (options.stacking === StackingMode.Percent) {
|
||||||
legendFields = fields.map((field) => {
|
legendFields = fields.map((field) => {
|
||||||
const alignedFrameField = frame.fields.find((f) => f.name === field.name)!;
|
const alignedFrameField = frame.fields.find((f) => {
|
||||||
|
if (f.labels) {
|
||||||
|
return f.name === field.name && f.labels.name === field.labels?.name;
|
||||||
|
}
|
||||||
|
return f.name === field.name;
|
||||||
|
})!;
|
||||||
|
|
||||||
const copy = {
|
const copy = {
|
||||||
...field,
|
...field,
|
||||||
|
Loading…
Reference in New Issue
Block a user