From 0c48a2058147ec45d4bd5e564076eae49c24dfcb Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 4 Nov 2020 12:43:56 +0000 Subject: [PATCH] Add support for dates and increase robustness --- .../userInterface/temporaryPanelStructure.js | 13 ++-- packages/standard-components/components.json | 10 ++- .../src/Chart/ApexChart.svelte | 6 +- .../src/Chart/ApexOptionsBuilder.js | 6 ++ .../src/Chart/BarChart.svelte | 77 ++++++++++++------- .../src/Chart/LineChart.svelte | 70 +++++++++++------ packages/standard-components/src/fetchData.js | 18 ++--- 7 files changed, 132 insertions(+), 68 deletions(-) diff --git a/packages/builder/src/components/userInterface/temporaryPanelStructure.js b/packages/builder/src/components/userInterface/temporaryPanelStructure.js index 55bd19ab64..70211fb6a5 100644 --- a/packages/builder/src/components/userInterface/temporaryPanelStructure.js +++ b/packages/builder/src/components/userInterface/temporaryPanelStructure.js @@ -452,6 +452,13 @@ export default { dependsOn: "datasource", control: MultiTableViewFieldSelect, }, + { + label: "Format", + key: "yAxisUnits", + control: OptionSelect, + options: ["Default", "Thousands", "Millions"], + defaultValue: "Default", + }, { label: "Y Axis Label", key: "yAxisLabel", @@ -486,12 +493,6 @@ export default { valueKey: "checked", defaultValue: false, }, - { - label: "Horizontal", - key: "horizontal", - control: Checkbox, - valueKey: "checked", - }, { label: "Data Labels", key: "dataLabels", diff --git a/packages/standard-components/components.json b/packages/standard-components/components.json index 59012fda01..f0b23d263a 100644 --- a/packages/standard-components/components.json +++ b/packages/standard-components/components.json @@ -413,7 +413,6 @@ "default": "400" }, "width": "number", - "horizontal": "bool", "dataLabels": "bool", "animate": { "type": "bool", @@ -422,7 +421,14 @@ "xAxisLabel": "string", "yAxisLabel": "string", "legend": "bool", - "stacked": "bool" + "stacked": "bool", + "yAxisUnits": { + "type": "options", + "default": "Default", + "options": [ + "Default", "Thousands", "Millions" + ] + } } }, "line": { diff --git a/packages/standard-components/src/Chart/ApexChart.svelte b/packages/standard-components/src/Chart/ApexChart.svelte index 91eed23acd..c83c7c47c2 100644 --- a/packages/standard-components/src/Chart/ApexChart.svelte +++ b/packages/standard-components/src/Chart/ApexChart.svelte @@ -4,7 +4,11 @@ export let options -
+{#if options} +
+{:else} +
Invalid chart options
+{/if}