Skip to content

Commit e586ab7

Browse files
Fix stacking bar chart (#7516)
1 parent 24ca513 commit e586ab7

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

viz-lib/src/visualizations/chart/plotly/fixtures/prepareData/bar/normalized.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
"series": [
4949
{
5050
"visible": true,
51-
"offsetgroup": "0",
5251
"type": "bar",
5352
"name": "a",
5453
"x": ["x1", "x2", "x3", "x4"],
@@ -64,7 +63,6 @@
6463
},
6564
{
6665
"visible": true,
67-
"offsetgroup": "1",
6866
"type": "bar",
6967
"name": "b",
7068
"x": ["x1", "x2", "x3", "x4"],

viz-lib/src/visualizations/chart/plotly/fixtures/prepareData/bar/stacked.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
"series": [
4949
{
5050
"visible": true,
51-
"offsetgroup": "0",
5251
"type": "bar",
5352
"name": "a",
5453
"x": ["x1", "x2", "x3", "x4"],
@@ -64,7 +63,6 @@
6463
},
6564
{
6665
"visible": true,
67-
"offsetgroup": "1",
6866
"type": "bar",
6967
"name": "b",
7068
"x": ["x1", "x2", "x3", "x4"],

viz-lib/src/visualizations/chart/plotly/prepareDefaultData.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ function getHoverInfoPattern(options: any) {
2626

2727
function prepareBarSeries(series: any, options: any, additionalOptions: any) {
2828
series.type = "bar";
29-
series.offsetgroup = toString(additionalOptions.index);
29+
if (!options.series.stacking) {
30+
series.offsetgroup = toString(additionalOptions.index);
31+
}
3032
if (options.showDataLabels) {
3133
series.textposition = "inside";
3234
} else {

0 commit comments

Comments
 (0)