BarChart: Fix legend and tooltip colors off by 1 after data refresh (#39234) (#39252)

(cherry picked from commit fb091de2c7)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2021-09-15 20:42:58 +02:00
committed by GitHub
co-authored by Leon Sorokin
parent da32c785c6
commit 71a9bf0203
@@ -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: {