mirror of
https://github.com/chartjs/Chart.js.git
synced 2026-03-05 07:54:04 +01:00
Stacked scatter chart (#7468)
* Handle partially stacked scatter charts * Update test files
This commit is contained in:
@@ -638,8 +638,9 @@ export default class DatasetController {
|
||||
let i, value, parsed, otherValue;
|
||||
|
||||
function _compute() {
|
||||
if (stack) {
|
||||
stack.values = parsed._stacks[scale.axis];
|
||||
const values = stack && parsed._stacks[scale.axis];
|
||||
if (stack && values) {
|
||||
stack.values = values;
|
||||
// Need to consider individual stack values for data range,
|
||||
// in addition to the stacked value
|
||||
min = Math.min(min, value);
|
||||
|
||||
68
test/fixtures/controller.line/stacking/stacked-scatter.js
vendored
Normal file
68
test/fixtures/controller.line/stacking/stacked-scatter.js
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
module.exports = {
|
||||
config: {
|
||||
type: 'scatter',
|
||||
data: {
|
||||
datasets: [{
|
||||
label: 'label1',
|
||||
data: [{
|
||||
x: 0,
|
||||
y: 30
|
||||
}, {
|
||||
x: 5,
|
||||
y: 35
|
||||
}, {
|
||||
x: 10,
|
||||
y: 20
|
||||
}],
|
||||
backgroundColor: '#42A8E4'
|
||||
},
|
||||
{
|
||||
label: 'label2',
|
||||
data: [{
|
||||
x: 0,
|
||||
y: 10
|
||||
}, {
|
||||
x: 5,
|
||||
y: 15
|
||||
}, {
|
||||
x: 10,
|
||||
y: 15
|
||||
}],
|
||||
backgroundColor: '#FC3F55'
|
||||
},
|
||||
{
|
||||
label: 'label3',
|
||||
data: [{
|
||||
x: 0,
|
||||
y: -15
|
||||
}, {
|
||||
x: 5,
|
||||
y: -10
|
||||
}, {
|
||||
x: 10,
|
||||
y: -20
|
||||
}],
|
||||
backgroundColor: '#FFBE3F'
|
||||
}],
|
||||
},
|
||||
options: {
|
||||
scales: {
|
||||
x: {
|
||||
display: false,
|
||||
position: 'bottom',
|
||||
},
|
||||
y: {
|
||||
stacked: true,
|
||||
display: false,
|
||||
position: 'left',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
options: {
|
||||
canvas: {
|
||||
height: 256,
|
||||
width: 512
|
||||
}
|
||||
}
|
||||
};
|
||||
BIN
test/fixtures/controller.line/stacking/stacked-scatter.png
vendored
Normal file
BIN
test/fixtures/controller.line/stacking/stacked-scatter.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.0 KiB |
Reference in New Issue
Block a user