chart clean up

This commit is contained in:
Gerard Burns 2024-04-19 09:40:15 +01:00
parent 46ae350370
commit 199005fc38
5 changed files with 33 additions and 5 deletions

View File

@ -99,7 +99,13 @@
return valueColumns.map(column => ({
name: column,
data: rows.map(row => {
return row?.[column]
const value = row?.[column]
if (dataProvider?.schema?.[column]?.type === "datetime" && value) {
return Date.parse(value);
}
return value
}),
}))
}

View File

@ -98,7 +98,13 @@
return valueColumns.map(column => ({
name: column,
data: rows.map(row => {
return row?.[column]
const value = row?.[column]
if (dataProvider?.schema?.[column]?.type === "datetime" && value) {
return Date.parse(value);
}
return value
}),
}))
}
@ -130,8 +136,6 @@
return formatters[valueUnits]
}
$: console.log("opt", options);
</script>
<ApexChart {options} />

View File

@ -61,6 +61,12 @@
return rows.map(row => {
const value = row?.[valueColumn]
if (dataProvider?.schema?.[valueColumn]?.type === "datetime" && value) {
return Date.parse(value);
}
// This chart doesn't automatically parse strings into numbers
const numValue = parseFloat(value);
if (isNaN(numValue)) {
return 0;

View File

@ -91,7 +91,13 @@
return valueColumns.map(column => ({
name: column,
data: rows.map(row => {
return row?.[column]
const value = row?.[column]
if (dataProvider?.schema?.[column]?.type === "datetime" && value) {
return Date.parse(value);
}
return value
}),
}))
}

View File

@ -61,6 +61,12 @@
return rows.map(row => {
const value = row?.[valueColumn]
if (dataProvider?.schema?.[valueColumn]?.type === "datetime" && value) {
return Date.parse(value);
}
// This chart doesn't automatically parse strings into numbers
const numValue = parseFloat(value);
if (isNaN(numValue)) {
return 0;