title: How to count linear regression with vue.js and chart.js
body: <p>for example, for the current data, I would like to be able to display a linear regression</p>
  <p>I did this in vista and I would like to ask you how I can proceed with the calculation?
  I don't really know how to use the formula
  My html</p>
  <pre><code>&lt;canvas id=&quot;orders_chart&quot; width=&quot;200&quot; height=&quot;200&quot;&gt;&lt;/canvas&gt;
  </code></pre>
  <p>my data</p>
  <pre><code>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
                      }
                  }
              }
  </code></pre>
  <p>and my functions</p>
  <pre><code>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,
              });
          }
      }
  </code></pre>
  <p>For example, what should I do now?
  I should just display a line on certain calculations, as far as I guess but I don't really know how I could do it :)</p>