3
0

Fix compose chart post-processing when value is 0

This commit is contained in:
Jože Fortun 2022-11-30 17:10:58 +01:00
parent db787191de
commit 1bba89a910

View File

@ -164,12 +164,12 @@ export class BaseChart {
// helper to choose between eight the provided value, default value or a generic 'undefined'
const pickValue = (val: unknown, { default: dDft }: Dimension): unknown => {
return val ? val : dDft || 'undefined'
return val || val === 0 ? val : dDft || 'undefined'
}
// Skip missing values; if so requested
if (dimension.skipMissing) {
results = results.filter((r: any) => r[dLabel])
results = results.filter((r: any) => r[dLabel] || r[dLabel] === 0)
}
// Not a time dimensions, build set of labels