Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/controllers/controller.scatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ export default class ScatterController extends DatasetController {

if (this.options.showLine) {

// https://github.com/chartjs/Chart.js/issues/11333
if (!this.datasetElementType) {
this.addElements();
}
const {dataset: line, _dataset} = meta;

// Update Line
Expand All @@ -84,6 +88,10 @@ export default class ScatterController extends DatasetController {
animated: !animationsDisabled,
options
}, mode);
} else if (this.datasetElementType) {
// https://github.com/chartjs/Chart.js/issues/11333
delete meta.dataset;
this.datasetElementType = false;
}

// Update Points
Expand Down
34 changes: 34 additions & 0 deletions test/fixtures/controller.scatter/showLine/changed.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
module.exports = {
description: 'showLine option should draw a line if true',
config: {
type: 'scatter',
data: {
datasets: [{
data: [{x: 10, y: 15}, {x: 15, y: 10}],
pointRadius: 10,
backgroundColor: 'red',
label: 'dataset1'
}],
},
options: {
scales: {
x: {
display: false
},
y: {
display: false
}
}
}
},
options: {
canvas: {
width: 256,
height: 256
},
run(chart) {
chart.options.showLine = true;
chart.update();
}
}
};
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.