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

This commit is contained in:
Leon Sorokin 2023-03-01 17:17:55 -06:00 committed by GitHub
parent afc9925dbf
commit 9314fe1056
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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,