fix(LineChart): skip lines at invalid/missing data points (don't force connect)

This commit is contained in:
Ola Rubaj
2025-01-22 16:23:17 +01:00
parent 12f0d0d732
commit 62dbc35d3b
4 changed files with 50 additions and 2 deletions

View File

@@ -47,11 +47,15 @@ export function LineChart({
color: 'black',
strokeWidth: 1,
tooltip: true,
invalid: "break-paths"
},
data: specData,
...(isMultiYAxis
? {
transform: [{ fold: yAxis, as: ['key', 'value'] }],
transform: [
{ fold: yAxis, as: ['key', 'value'] },
{ filter: 'datum.value != null && datum.value != ""' }
],
}
: {}),
selection: {

View File

@@ -8,7 +8,7 @@
type URL = string; // Just in case we want to transform it into an object with configurations
export interface Data {
url?: URL;
values?: { [key: string]: number | string }[];
values?: { [key: string]: number | string | null | undefined }[];
csv?: string;
}