Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: respect minBarLength in stacked bar chart (#10766)
- Loading branch information
Showing
7 changed files
with
139 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
test/fixtures/controller.bar/minBarLength/horizontal-stacked-no-overlap.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
const minBarLength = 50; | ||
|
||
module.exports = { | ||
config: { | ||
type: 'bar', | ||
data: { | ||
labels: [1, 2, 3, 4], | ||
datasets: [ | ||
{ | ||
data: [1, -1, 1, 20], | ||
backgroundColor: '#bb000066', | ||
minBarLength | ||
}, | ||
{ | ||
data: [1, -1, -1, -20], | ||
backgroundColor: '#00bb0066', | ||
minBarLength | ||
}, | ||
{ | ||
data: [1, -1, 1, 40], | ||
backgroundColor: '#0000bb66', | ||
minBarLength | ||
}, | ||
{ | ||
data: [1, -1, -1, -40], | ||
backgroundColor: '#00000066', | ||
minBarLength | ||
} | ||
] | ||
}, | ||
options: { | ||
indexAxis: 'y', | ||
scales: { | ||
x: { | ||
display: false, | ||
stacked: true | ||
}, | ||
y: { | ||
type: 'linear', | ||
position: 'left', | ||
stacked: true, | ||
ticks: { | ||
display: false | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
options: { | ||
canvas: { | ||
height: 512, | ||
width: 512 | ||
} | ||
} | ||
}; |
Binary file added
BIN
+8.35 KB
test/fixtures/controller.bar/minBarLength/horizontal-stacked-no-overlap.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions
54
test/fixtures/controller.bar/minBarLength/vertical-stacked-no-overlap.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
const minBarLength = 50; | ||
|
||
module.exports = { | ||
config: { | ||
type: 'bar', | ||
data: { | ||
labels: [1, 2, 3, 4], | ||
datasets: [ | ||
{ | ||
data: [1, -1, 1, 20], | ||
backgroundColor: '#bb000066', | ||
minBarLength | ||
}, | ||
{ | ||
data: [1, -1, -1, -20], | ||
backgroundColor: '#00bb0066', | ||
minBarLength | ||
}, | ||
{ | ||
data: [1, -1, 1, 40], | ||
backgroundColor: '#0000bb66', | ||
minBarLength | ||
}, | ||
{ | ||
data: [1, -1, -1, -40], | ||
backgroundColor: '#00000066', | ||
minBarLength | ||
} | ||
] | ||
}, | ||
options: { | ||
scales: { | ||
x: { | ||
display: false, | ||
stacked: true | ||
}, | ||
y: { | ||
type: 'linear', | ||
position: 'left', | ||
stacked: true, | ||
ticks: { | ||
display: false | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
options: { | ||
canvas: { | ||
height: 512, | ||
width: 512 | ||
} | ||
} | ||
}; |
Binary file added
BIN
+12.2 KB
test/fixtures/controller.bar/minBarLength/vertical-stacked-no-overlap.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters