From ac9d5e660d0e6082a97411f8bf0c5076e7bad9fc Mon Sep 17 00:00:00 2001 From: cmack Date: Mon, 3 Aug 2020 14:42:37 +0100 Subject: [PATCH] Re-adding datachart for testing --- .../userInterface/temporaryPanelStructure.js | 32 +++++++++++++++++++ .../standard-components/src/DataChart.svelte | 2 ++ 2 files changed, 34 insertions(+) diff --git a/packages/builder/src/components/userInterface/temporaryPanelStructure.js b/packages/builder/src/components/userInterface/temporaryPanelStructure.js index 6d929d333c..c4b24a76da 100644 --- a/packages/builder/src/components/userInterface/temporaryPanelStructure.js +++ b/packages/builder/src/components/userInterface/temporaryPanelStructure.js @@ -365,6 +365,38 @@ export default { }, ], }, + { + name: "Data Chart", + _component: "@budibase/standard-components/datachart", + description: "Shiny chart", + icon: "ri-bar-chart-line", + properties: { + design: { ...all }, + settings: [ + { label: "Table", key: "model", control: ModelSelect }, + { + label: "Chart Type", + key: "type", + control: OptionSelect, + options: [ + "column2d", + "column3d", + "line", + "area2d", + "bar2d", + "bar3d", + "pie2d", + "pie3d", + "doughnut2d", + "doughnut3d", + "pareto2d", + "pareto3d", + ], + }, + ], + }, + children: [], + }, { name: "Chart", description: "Shiny chart", diff --git a/packages/standard-components/src/DataChart.svelte b/packages/standard-components/src/DataChart.svelte index bccfc6314a..8b6dcdcc17 100644 --- a/packages/standard-components/src/DataChart.svelte +++ b/packages/standard-components/src/DataChart.svelte @@ -23,6 +23,8 @@ }, } + $: console.log("CHART CONFIGS", chartConfigs) + async function fetchData() { const FETCH_RECORDS_URL = `/api/views/all_${model}` const response = await _bb.api.get(FETCH_RECORDS_URL)