diff --git a/packages/builder/src/components/design/settings/controls/FieldContext/ExplanationModal/subjects/StringsAsNumbers.svelte b/packages/builder/src/components/design/settings/controls/FieldContext/ExplanationModal/subjects/StringsAsNumbers.svelte index 0accdcd197..f2148a6255 100644 --- a/packages/builder/src/components/design/settings/controls/FieldContext/ExplanationModal/subjects/StringsAsNumbers.svelte +++ b/packages/builder/src/components/design/settings/controls/FieldContext/ExplanationModal/subjects/StringsAsNumbers.svelte @@ -4,7 +4,7 @@
- Text can be used in place of numbers in certain scenarios, but care needs to be taken, as text that doesn't contain a strictly base-ten, non-decimal value may lead to unexpected behavior. + Text can be used in place of numbers in certain scenarios, but care needs to be taken, as text that doesn't contain a strictly base-ten integer or decimal value may lead to unexpected behavior.
@@ -18,7 +18,7 @@
"100 million"{" -> "}100
- "100.9"{" -> "}100 + "100.9"{" -> "}100.9
"One hundred"{" -> "}Error
diff --git a/packages/client/src/components/app/charts/PieChart.svelte b/packages/client/src/components/app/charts/PieChart.svelte index 8cb7317d94..feaa0bcab9 100644 --- a/packages/client/src/components/app/charts/PieChart.svelte +++ b/packages/client/src/components/app/charts/PieChart.svelte @@ -80,7 +80,13 @@ .colors(customColor ? colors : null) // Add data if valid datasource - const series = data.map(row => parseFloat(row[valueColumn])) + const series = data.map(row => { + if (schema[valueColumn].type === 'datetime') { + return Date.parse(row[valueColumn]) + } + + return parseFloat(row[valueColumn]) + }) const labels = data.map(row => row[labelColumn]) builder = builder.series(series).labels(labels)