if (this.options.showLine) {
+ // https://github.com/chartjs/Chart.js/issues/11333
+ if (!this.datasetElementType) {
+ this.addElements();
+ }
const {dataset: line, _dataset} = meta;
// Update Line
animated: !animationsDisabled,
options
}, mode);
+ } else if (this.datasetElementType) {
+ // https://github.com/chartjs/Chart.js/issues/11333
+ delete meta.dataset;
+ this.datasetElementType = false;
}
// Update Points
--- /dev/null
+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();
+ }
+ }
+};