Take for instance, with the current dataset, I am looking to showcase a linear regression
I managed to do this in Vista and now I need guidance on how to proceed with the calculation. I am not too familiar with using the formula Here is my HTML:
<canvas id="orders_chart" width="200" height="200"></canvas>
This is my data:
type: 'line',
data: {
labels: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30],
datasets: [
{
label: 'Orders',
data: [1, 0, 1, 0, 2, 8, 9, 2, 0, 0, 0, 0, 1, 0, 0, 5, 1, 5, 5, 5, 0, 1, 5, 0, 0, 1, 3, 5, 9, 15],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(54, 162, 235, 0.2)',
'rgba(255, 206, 86, 0.2)',
'rgba(75, 192, 192, 0.2)',
'rgba(153, 102, 255, 0.2)',
'rgba(255, 159, 64, 0.2)'
],
borderColor: [
'rgba(255, 99, 132, 1)',
'rgba(54, 162, 235, 1)',
'rgba(255, 206, 86, 1)',
'rgba(75, 192, 192, 1)',
'rgba(153, 102, 255, 1)',
'rgba(255, 159, 64, 1)'
],
borderWidth: 1
}]
},
options: {
scales: {
y: {
beginAtZero: true
}
}
}
Additionally, here are my functions:
mounted() {
this.createChart()
},
methods: {
createChart() {
const ctx = document.getElementById('orders_chart');
const myChart = new Chart(ctx, {
type: this.type,
data: this.data,
options: this.options,
});
}
}
Now, what steps should I take next? I believe I need to simply show a line based on certain calculations, but I'm unsure of the exact process :)