Skip to content

Commit

Permalink
BarChart: Fix legend and tooltip colors off by 1 after data refresh (#…
Browse files Browse the repository at this point in the history
…39234)

(cherry picked from commit fb091de)
  • Loading branch information
leeoniya authored and grafanabot committed Sep 15, 2021
1 parent da32c78 commit ab18953
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions public/app/plugins/panel/barchart/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,16 @@ export function prepareGraphableFrames(
};
}

let seriesIndex = 0;

for (let frame of series) {
const fields: Field[] = [];
for (const field of frame.fields) {
if (field.type === FieldType.number) {
field.state = field.state ?? {};

field.state.seriesIndex = seriesIndex++;

let copy = {
...field,
config: {
Expand Down

0 comments on commit ab18953

Please sign in to comment.