Added ability to add custom configs to pie charts
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user