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

This commit is contained in:
Leon Sorokin 2021-09-15 13:10:26 -05:00 committed by GitHub
parent 2a4b08eab9
commit fb091de2c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -246,10 +246,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: {