diff --git a/packages/lib/src/components/buttons/SearchButtonComponenet.wc.svelte b/packages/lib/src/components/buttons/SearchButtonComponenet.wc.svelte index 7c3093a8..e5d9bae4 100644 --- a/packages/lib/src/components/buttons/SearchButtonComponenet.wc.svelte +++ b/packages/lib/src/components/buttons/SearchButtonComponenet.wc.svelte @@ -63,6 +63,7 @@ if (controller) { controller.abort(); } + responseStore.set(new Map()); controller = new AbortController(); diff --git a/packages/lib/src/components/results/ChartComponent.wc.svelte b/packages/lib/src/components/results/ChartComponent.wc.svelte index 0e073457..0fee1ad0 100644 --- a/packages/lib/src/components/results/ChartComponent.wc.svelte +++ b/packages/lib/src/components/results/ChartComponent.wc.svelte @@ -123,7 +123,7 @@ title: { display: true, text: yAxisTitle - } + }, }, x: { display: viewScales, @@ -133,12 +133,12 @@ }, ticks: (chartType === "bar") ? { callback: (val: any) => { - if (typeof val === 'string') return val.toString() - const key: unknown = (initialChartData.data.labels[val]) + if(indexAxis === 'y') return val.toString() + if (typeof val === 'string') return val + const key: unknown = (initialChartData.data.labels[val]) !== undefined ? initialChartData.data.labels[val] : val.toString(); if (typeof key !== 'string') return val.toString() - let result = (headers.get(key)) - ? headers.get(key) : key; + let result = (headers.get(key)) ? headers.get(key) : key; return result } } : [] @@ -373,9 +373,7 @@ }; $: { - if ($responseStore.size !== 0) { - setChartData($responseStore); - } + setChartData($responseStore); } onMount(() => {