mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 12:19:08 +02:00
Line: update all points when scale range changes (#8703)
This commit is contained in:
parent
8ed689877f
commit
74f2f85ec3
@ -20,7 +20,7 @@ export default class LineController extends DatasetController {
|
||||
me._drawStart = start;
|
||||
me._drawCount = count;
|
||||
|
||||
if (scaleRangesChanged(meta) && !animationsDisabled) {
|
||||
if (scaleRangesChanged(meta)) {
|
||||
start = 0;
|
||||
count = points.length;
|
||||
}
|
||||
|
29
test/fixtures/plugin.filler/points-outside-canvas-initial.js
vendored
Normal file
29
test/fixtures/plugin.filler/points-outside-canvas-initial.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
module.exports = {
|
||||
description: 'https://github.com/chartjs/Chart.js/issues/8699',
|
||||
config: {
|
||||
type: 'line',
|
||||
data: {
|
||||
datasets: [{
|
||||
backgroundColor: 'red',
|
||||
data: [{x: 0, y: 3}, {x: 2, y: -3}, {x: 4, y: 0}, {x: 6, y: 5}, {x: 8, y: -5}, {x: 10, y: 0}],
|
||||
fill: 'origin'
|
||||
}]
|
||||
},
|
||||
options: {
|
||||
plugins: {
|
||||
legend: false,
|
||||
title: false,
|
||||
},
|
||||
scales: {
|
||||
x: {
|
||||
display: false,
|
||||
type: 'linear',
|
||||
min: 5
|
||||
},
|
||||
y: {
|
||||
display: false
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
BIN
test/fixtures/plugin.filler/points-outside-canvas-initial.png
vendored
Normal file
BIN
test/fixtures/plugin.filler/points-outside-canvas-initial.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
34
test/fixtures/plugin.filler/points-outside-canvas-update.js
vendored
Normal file
34
test/fixtures/plugin.filler/points-outside-canvas-update.js
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
module.exports = {
|
||||
description: 'https://github.com/chartjs/Chart.js/issues/8699',
|
||||
config: {
|
||||
type: 'line',
|
||||
data: {
|
||||
datasets: [{
|
||||
backgroundColor: 'red',
|
||||
data: [{x: 0, y: 3}, {x: 2, y: -3}, {x: 4, y: 0}, {x: 6, y: 5}, {x: 8, y: -5}, {x: 10, y: 0}],
|
||||
fill: 'origin'
|
||||
}]
|
||||
},
|
||||
options: {
|
||||
plugins: {
|
||||
legend: false,
|
||||
title: false,
|
||||
},
|
||||
scales: {
|
||||
x: {
|
||||
type: 'linear',
|
||||
display: false
|
||||
},
|
||||
y: {
|
||||
display: false
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
options: {
|
||||
run(chart) {
|
||||
chart.scales.x.options.min = 5;
|
||||
chart.update();
|
||||
}
|
||||
}
|
||||
};
|
BIN
test/fixtures/plugin.filler/points-outside-canvas-update.png
vendored
Normal file
BIN
test/fixtures/plugin.filler/points-outside-canvas-update.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
Loading…
Reference in New Issue
Block a user