From c3401486cccb86d0c727995f4932a951b93e09a3 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 18 Mar 2021 18:45:11 +0000 Subject: [PATCH] Update all charts to work with new data provider --- packages/standard-components/manifest.json | 15 ++++++--- .../src/charts/ApexChart.svelte | 4 +-- .../src/charts/BarChart.svelte | 30 ++++++----------- .../src/charts/CandleStickChart.svelte | 32 +++++++------------ .../src/charts/LineChart.svelte | 32 +++++++------------ .../src/charts/PieChart.svelte | 30 +++++++---------- 6 files changed, 54 insertions(+), 89 deletions(-) diff --git a/packages/standard-components/manifest.json b/packages/standard-components/manifest.json index 02b31d5b1a..50812fc1dd 100644 --- a/packages/standard-components/manifest.json +++ b/packages/standard-components/manifest.json @@ -1081,19 +1081,19 @@ "type": "field", "label": "Close Col.", "key": "closeColumn", - "dependsOn": "datasource" + "dependsOn": "dataProvider" }, { "type": "field", "label": "High Col.", "key": "highColumn", - "dependsOn": "datasource" + "dependsOn": "dataProvider" }, { "type": "field", "label": "Low Col.", "key": "lowColumn", - "dependsOn": "datasource" + "dependsOn": "dataProvider" }, { "type": "select", @@ -1137,7 +1137,9 @@ "styleable": true, "hasChildren": true, "dataProvider": true, - "actions": ["ValidateForm"], + "actions": [ + "ValidateForm" + ], "settings": [ { "type": "schema", @@ -1190,7 +1192,10 @@ "key": "disabled", "defaultValue": false } - ] + ], + "dataContext": { + "type": "form" + } }, "fieldgroup": { "name": "Field Group", diff --git a/packages/standard-components/src/charts/ApexChart.svelte b/packages/standard-components/src/charts/ApexChart.svelte index 0c2e1b0e41..cf9cade436 100644 --- a/packages/standard-components/src/charts/ApexChart.svelte +++ b/packages/standard-components/src/charts/ApexChart.svelte @@ -2,7 +2,7 @@ import { getContext } from "svelte" import { chart } from "svelte-apexcharts" - const { styleable } = getContext("sdk") + const { styleable, builderStore } = getContext("sdk") const component = getContext("component") export let options @@ -10,7 +10,7 @@ {#if options}
-{:else if options === false} +{:else if builderStore.inBuilder}
Use the settings panel to build your chart -->
diff --git a/packages/standard-components/src/charts/BarChart.svelte b/packages/standard-components/src/charts/BarChart.svelte index 4bebdf1407..a2259aa754 100644 --- a/packages/standard-components/src/charts/BarChart.svelte +++ b/packages/standard-components/src/charts/BarChart.svelte @@ -1,10 +1,6 @@ diff --git a/packages/standard-components/src/charts/CandleStickChart.svelte b/packages/standard-components/src/charts/CandleStickChart.svelte index c5ca0ebd49..9435b27cfd 100644 --- a/packages/standard-components/src/charts/CandleStickChart.svelte +++ b/packages/standard-components/src/charts/CandleStickChart.svelte @@ -1,13 +1,9 @@ diff --git a/packages/standard-components/src/charts/LineChart.svelte b/packages/standard-components/src/charts/LineChart.svelte index cdfb4f5fbf..47823955c0 100644 --- a/packages/standard-components/src/charts/LineChart.svelte +++ b/packages/standard-components/src/charts/LineChart.svelte @@ -1,14 +1,10 @@ diff --git a/packages/standard-components/src/charts/PieChart.svelte b/packages/standard-components/src/charts/PieChart.svelte index 7b8df25b01..19cb1d2472 100644 --- a/packages/standard-components/src/charts/PieChart.svelte +++ b/packages/standard-components/src/charts/PieChart.svelte @@ -1,13 +1,9 @@