From 756781c3a90c02ba1e06ee662ca17833d35a3bfa Mon Sep 17 00:00:00 2001 From: asantibanez Date: Wed, 1 Feb 2023 18:32:06 -0500 Subject: [PATCH] Added ability to add custom configs to pie charts --- resources/js/pieChart.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/js/pieChart.js b/resources/js/pieChart.js index 144f239..5f61bb9 100644 --- a/resources/js/pieChart.js +++ b/resources/js/pieChart.js @@ -1,3 +1,4 @@ +import {mergedOptionsWithJsonConfig} from './helpers' const pieChart = () => { return { @@ -21,6 +22,7 @@ const pieChart = () => { const data = component.get('pieChartModel.data') const sparkline = component.get('pieChartModel.sparkline') const type = component.get('pieChartModel.type') + const jsonConfig = component.get('pieChartModel.jsonConfig'); const options = { series: data.map(item => item.value), @@ -89,7 +91,7 @@ const pieChart = () => { options['colors'] = colors } - this.chart = new ApexCharts(this.$refs.container, options); + this.chart = new ApexCharts(this.$refs.container, mergedOptionsWithJsonConfig(options, jsonConfig)); this.chart.render(); } }