@juspay/svelte-ui-components 2.101.0 → 2.102.0
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.
|
@@ -246,6 +246,9 @@
|
|
|
246
246
|
let isStackedMode = $derived(isMulti && groupMode === 'stacked');
|
|
247
247
|
|
|
248
248
|
function getDisplayValue(bar: BarRect): string {
|
|
249
|
+
if (typeof bar.dataPoint.valueLabel === 'string' && bar.dataPoint.valueLabel.length > 0) {
|
|
250
|
+
return bar.dataPoint.valueLabel;
|
|
251
|
+
}
|
|
249
252
|
if (isNormalized && bar.normalizedValue != null) {
|
|
250
253
|
return normalizedFormat(bar.normalizedValue);
|
|
251
254
|
}
|
|
@@ -40,6 +40,12 @@ export type BarChartDataPoint = {
|
|
|
40
40
|
range?: [number, number];
|
|
41
41
|
/** Per-bar fill: plain color, pattern, or gradient. Overrides series color. */
|
|
42
42
|
color?: BarFill;
|
|
43
|
+
/**
|
|
44
|
+
* Custom text for this bar's value label, rendered verbatim instead of the
|
|
45
|
+
* `valueFormat(value)` output. Lets a caller label a single bar differently —
|
|
46
|
+
* e.g. a funnel baseline showing a raw count while the rest show a percentage.
|
|
47
|
+
*/
|
|
48
|
+
valueLabel?: string;
|
|
43
49
|
};
|
|
44
50
|
export type BarChartSeries = {
|
|
45
51
|
name: string;
|