diff --git a/src/modules/DataLabels.js b/src/modules/DataLabels.js index 20ccb04e8..691ee5dc0 100644 --- a/src/modules/DataLabels.js +++ b/src/modules/DataLabels.js @@ -212,8 +212,9 @@ class DataLabels { let dataLabelColor = w.globals.dataLabels.style.colors[i] if ( - (w.config.chart.type === 'bar' || w.config.chart.type === 'rangeBar') && - w.config.plotOptions.bar.distributed + ((w.config.chart.type === 'bar' || w.config.chart.type === 'rangeBar') && + w.config.plotOptions.bar.distributed) || + w.config.dataLabels.distributed ) { dataLabelColor = w.globals.dataLabels.style.colors[j] } diff --git a/src/modules/settings/Options.js b/src/modules/settings/Options.js index bb48ad797..51efc2a56 100644 --- a/src/modules/settings/Options.js +++ b/src/modules/settings/Options.js @@ -572,6 +572,7 @@ export default class Options { return val !== null ? val : '' }, textAnchor: 'middle', + distributed: false, offsetX: 0, offsetY: 0, style: { diff --git a/types/apexcharts.d.ts b/types/apexcharts.d.ts index f3b3ecbde..ae3572893 100644 --- a/types/apexcharts.d.ts +++ b/types/apexcharts.d.ts @@ -757,6 +757,7 @@ type ApexDataLabels = { enabled?: boolean enabledOnSeries?: undefined | number[] textAnchor?: 'start' | 'middle' | 'end' + distributed?: boolean offsetX?: number offsetY?: number style?: {