1👍
Try concatenating the arrays like so:
//var xArray = [{x: ?,y: ?}, {x: ?,y: ?}];
//var yArray = [{x: ?,y: ?}, {x: ?,y: ?}];
var concatenatedArray = xArray.concat(yArray);
Then, you can pass that in when you’re invoking your chart like so:
var scatterChart = new Chart(ctx, {
type: 'line',
data: {
datasets: concatenatedArray
},
options: {
scales: {
xAxes: [{
type: 'linear',
position: 'bottom'
}]
}
}
});
I hope this helps – keep me posted!
- [Chartjs]-Creating a grouped and stacked chart in Chart.js
- [Chartjs]-Angular-chart.js : how to show numbers in each bar of stacked bar chart
Source:stackexchange.com