diff --git a/packages/standard-components/src/Chart/ApexChart.svelte b/packages/standard-components/src/Chart/ApexChart.svelte index c83c7c47c2..5bf319e7ea 100644 --- a/packages/standard-components/src/Chart/ApexChart.svelte +++ b/packages/standard-components/src/Chart/ApexChart.svelte @@ -6,7 +6,7 @@ {#if options}
-{:else} +{:else if options === false}
Invalid chart options
{/if} diff --git a/packages/standard-components/src/Chart/BarChart.svelte b/packages/standard-components/src/Chart/BarChart.svelte index b008ac4b31..f73b74a1e7 100644 --- a/packages/standard-components/src/Chart/BarChart.svelte +++ b/packages/standard-components/src/Chart/BarChart.svelte @@ -26,6 +26,7 @@ // Fetch data on mount onMount(async () => { if (!datasource || !labelColumn || !valueColumns || !valueColumns.length) { + options = false return } @@ -39,6 +40,7 @@ .slice(0, 20) .sort((a, b) => (a[labelColumn] > b[labelColumn] ? 1 : -1)) if (!schema || !data.length) { + options = false return } diff --git a/packages/standard-components/src/Chart/CandleStickChart.svelte b/packages/standard-components/src/Chart/CandleStickChart.svelte index 7b90e226e9..1f849b2fd5 100644 --- a/packages/standard-components/src/Chart/CandleStickChart.svelte +++ b/packages/standard-components/src/Chart/CandleStickChart.svelte @@ -26,6 +26,7 @@ onMount(async () => { const allCols = [dateColumn, openColumn, highColumn, lowColumn, closeColumn] if (!datasource || allCols.find(x => x == null)) { + options = false return } @@ -39,6 +40,7 @@ .slice(0, 100) .sort((a, b) => (a[dateColumn] > b[dateColumn] ? 1 : -1)) if (!schema || !data.length) { + options = false return } diff --git a/packages/standard-components/src/Chart/LineChart.svelte b/packages/standard-components/src/Chart/LineChart.svelte index d3e459154a..2697465877 100644 --- a/packages/standard-components/src/Chart/LineChart.svelte +++ b/packages/standard-components/src/Chart/LineChart.svelte @@ -32,6 +32,7 @@ // Fetch data on mount onMount(async () => { if (!datasource || !labelColumn || !valueColumns || !valueColumns.length) { + options = false return } @@ -45,6 +46,7 @@ .slice(0, 100) .sort((a, b) => (a[labelColumn] > b[labelColumn] ? 1 : -1)) if (!schema || !data.length) { + options = false return } diff --git a/packages/standard-components/src/Chart/PieChart.svelte b/packages/standard-components/src/Chart/PieChart.svelte index 6b747b4258..96f659bf7d 100644 --- a/packages/standard-components/src/Chart/PieChart.svelte +++ b/packages/standard-components/src/Chart/PieChart.svelte @@ -23,6 +23,7 @@ // Fetch data on mount onMount(async () => { if (!datasource || !labelColumn || !valueColumn) { + options = false return } @@ -34,6 +35,7 @@ .slice(0, 20) .sort((a, b) => (a[labelColumn] > b[labelColumn] ? 1 : -1)) if (!schema || !data.length) { + options = false return }