TimeSeries: fix fillBelowTo wrongly affecting fills of unrelated series (#41998) (#42014)

(cherry picked from commit 07a440fd3a)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2021-11-19 15:52:26 -06:00
committed by GitHub
co-authored by Leon Sorokin
parent 69c1626f8f
commit e36664bae8
@@ -231,13 +231,13 @@ export class UPlotConfigBuilder {
// When fillBelowTo option enabled, handle series bands fill manually
if (this.bands?.length) {
config.bands = this.bands;
const keepFill = new Set<number>();
const killFill = new Set<number>();
for (const b of config.bands) {
keepFill.add(b.series[0]);
killFill.add(b.series[1]);
}
for (let i = 1; i < config.series.length; i++) {
if (!keepFill.has(i)) {
if (killFill.has(i)) {
config.series[i].fill = undefined;
}
}