@classic-homes/charts-svelte 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import type { BarChartProps } from '@classic-homes/charts-core';
|
|
8
8
|
import {
|
|
9
9
|
allSeriesEmpty,
|
|
10
|
+
barCornerRadius,
|
|
10
11
|
buildAxis,
|
|
11
12
|
buildDataLabel,
|
|
12
13
|
buildDataZoom,
|
|
@@ -143,6 +144,7 @@
|
|
|
143
144
|
const zoomAxis = isHorizontal ? 'y' : 'x';
|
|
144
145
|
const legendBottom = builtInLegend && (legendConfig?.position ?? 'bottom') === 'bottom';
|
|
145
146
|
|
|
147
|
+
const stackIds = data.series.map((s) => s.stack ?? (stacked ? 'Total' : undefined));
|
|
146
148
|
const series = data.series.map((source, index) => ({
|
|
147
149
|
name: source.name,
|
|
148
150
|
type: 'bar',
|
|
@@ -152,8 +154,11 @@
|
|
|
152
154
|
formatters.label,
|
|
153
155
|
{ position: labelPosition }
|
|
154
156
|
),
|
|
155
|
-
stack:
|
|
156
|
-
itemStyle:
|
|
157
|
+
stack: stackIds[index],
|
|
158
|
+
itemStyle: {
|
|
159
|
+
...(source.color && { color: source.color }),
|
|
160
|
+
borderRadius: barCornerRadius(isHorizontal, stackIds, index),
|
|
161
|
+
},
|
|
157
162
|
label: buildDataLabel({ show: true, position: labelPosition }, undefined, {
|
|
158
163
|
show: showValues,
|
|
159
164
|
formatter: formatters.label,
|