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

This commit is contained in:
Leon Sorokin 2021-11-19 14:42:04 -06:00 committed by GitHub
parent 7f3562886e
commit 07a440fd3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}
}