[v9.4.x] BarChart: Only apply radius to topmost bar segment when stacking (#63986)

BarChart: Only apply radius to topmost bar segment when stacking (#63906)

(cherry picked from commit 9314fe1056)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2023-03-01 18:28:14 -05:00
committed by GitHub
co-authored by Leon Sorokin
parent 0299b18b88
commit 64412b1195
+8 -1
View File
@@ -286,7 +286,14 @@ export function getConfig(opts: BarsOptions, theme: GrafanaTheme2) {
: {};
let barsBuilder = uPlot.paths.bars!({
radius: barRadius,
radius: pctStacked
? 0
: !isStacked
? barRadius
: (u: uPlot, seriesIdx: number) => {
let isTopmostSeries = seriesIdx === u.data.length - 1;
return isTopmostSeries ? [barRadius, 0] : [0, 0];
},
disp: {
x0: {
unit: 2,