mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
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:
@@ -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 = [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user