fix(echarts): Display NULL values in categorical x-axis for bar charts (#34761)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Evan Rusackas
2025-09-02 12:16:37 -07:00
committed by GitHub
parent 5dba59b6a4
commit 682cdcc3e0
4 changed files with 52 additions and 8 deletions

View File

@@ -493,6 +493,43 @@ describe('extractSeries', () => {
]);
});
it('should convert NULL x-values to NULL_STRING for categorical axis', () => {
const data = [
{
browser: 'Firefox',
count: 5,
},
{
browser: null,
count: 10,
},
{
browser: 'Chrome',
count: 8,
},
];
expect(
extractSeries(data, {
xAxis: 'browser',
xAxisType: AxisType.Category,
}),
).toEqual([
[
{
id: 'count',
name: 'count',
data: [
['Firefox', 5],
[NULL_STRING, 10],
['Chrome', 8],
],
},
],
[],
5,
]);
});
it('should do missing value imputation', () => {
const data = [
{