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

This commit is contained in:
Leon Sorokin 2022-04-25 23:57:59 -05:00 committed by GitHub
parent eef22c05e1
commit fe7b594bbd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -499,7 +499,7 @@ describe('GraphNG utils', () => {
],
},
],
"length": 10,
"length": 12,
}
`);
});

View File

@ -13,7 +13,9 @@ import { nullToUndefThreshold } from './nullToUndefThreshold';
import { XYFieldMatchers } from './types';
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
@ -105,6 +107,8 @@ export function preparePlotFrame(frames: DataFrame[], dimFields: XYFieldMatchers
vals.push(undefined, undefined);
}
});
alignedFrame.length += 2;
}
return alignedFrame;