diff --git a/packages/client/src/components/app/charts/ApexChart.svelte b/packages/client/src/components/app/charts/ApexChart.svelte index 09771ce9a5..506143852c 100644 --- a/packages/client/src/components/app/charts/ApexChart.svelte +++ b/packages/client/src/components/app/charts/ApexChart.svelte @@ -11,27 +11,23 @@ // Apex charts directly modifies the options object with default properties and internal variables. These being present could unintentionally cause issues to the provider of this prop as the changes are reflected in that component as well. To prevent any issues we clone options here to provide a buffer. $: optionsCopy = cloneDeep(options); - $: console.log(cloneDeep(options)); let chartElement; let chart; let currentType = null const updateChart = async (newOptions) => { - console.log('update') - // Line charts won't transition from category to datetime types properly without - // calling this with an empty object first; I don't know why this works. + // Line charts have issues transitioning between "datetime" and "category" types, and will ignore the provided formatters + // in certain scenarios. Rerendering the chart when the user changes label type fixes this, but unfortunately it does + // cause a little bit of jankiness with animations. if (newOptions?.xaxis?.type && newOptions.xaxis.type !== currentType ) { - console.log('calling render') await renderChart(chartElement); - } else { await chart?.updateOptions(newOptions) } } const renderChart = async (newChartElement) => { - console.log('render') await chart?.destroy() chart = new ApexCharts(newChartElement, optionsCopy) currentType = optionsCopy?.xaxis?.type diff --git a/packages/client/src/components/app/charts/HistogramChart.svelte b/packages/client/src/components/app/charts/HistogramChart.svelte index 26b9028550..0cc74cc0ce 100644 --- a/packages/client/src/components/app/charts/HistogramChart.svelte +++ b/packages/client/src/components/app/charts/HistogramChart.svelte @@ -1,135 +1,137 @@