TimeSeries: update frame.length when syncing bar widths (#48223) (#48236)

(cherry picked from commit fe7b594bbd)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2022-04-26 07:15:56 +02:00
committed by GitHub
co-authored by Leon Sorokin
parent 7bf41c7e39
commit ec0ccc6b30
2 changed files with 6 additions and 2 deletions
@@ -499,7 +499,7 @@ describe('GraphNG utils', () => {
], ],
}, },
], ],
"length": 10, "length": 12,
} }
`); `);
}); });
@@ -13,7 +13,9 @@ import { nullToUndefThreshold } from './nullToUndefThreshold';
import { XYFieldMatchers } from './types'; import { XYFieldMatchers } from './types';
function isVisibleBarField(f: Field) { function isVisibleBarField(f: Field) {
return f.config.custom?.drawStyle === GraphDrawStyle.Bars && !f.config.custom?.hideFrom?.viz; return (
f.type === FieldType.number && f.config.custom?.drawStyle === GraphDrawStyle.Bars && !f.config.custom?.hideFrom?.viz
);
} }
// will mutate the DataFrame's fields' values // will mutate the DataFrame's fields' values
@@ -105,6 +107,8 @@ export function preparePlotFrame(frames: DataFrame[], dimFields: XYFieldMatchers
vals.push(undefined, undefined); vals.push(undefined, undefined);
} }
}); });
alignedFrame.length += 2;
} }
return alignedFrame; return alignedFrame;