Field: use 0-based field.state.seriesIndex (#37563) (#37565)

(cherry picked from commit 1fe3452886)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2021-08-04 20:29:00 +02:00
committed by GitHub
co-authored by Leon Sorokin
parent 30071cee1a
commit 889e1ab729
@@ -169,16 +169,16 @@ export function applyFieldOverrides(options: ApplyFieldOverrideOptions): DataFra
range = { min, max, delta: max! - min! };
}
field.state!.seriesIndex = seriesIndex;
field.state!.range = range;
field.type = type;
// Some color modes needs series index to assign field color so we count
// up series index here but ignore time fields
if (field.type !== FieldType.time) {
seriesIndex++;
}
field.state!.seriesIndex = seriesIndex;
field.state!.range = range;
field.type = type;
// and set the display processor using it
field.display = getDisplayProcessor({
field: field,