Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

200
Views
Use an array as chart values

I need an array with chart values, I obtained one but after exiting from the function it became blank, here's what happens: Example

    function AddvotoTec(votor) {
      class Avg {
        constructor() {}
        static average(votor) {
          var total = 0;
          var count = 0;
          jQuery.each(votor, function(index, value) {
                total += value;
                count++;
          });
          return total / count;
        }
      }
      var mvoti = Avg.average(votor);
      var mvoti = Math.round((mvoti + Number.EPSILON) * 10) / 10;
      const myJSON = JSON.stringify(mvoti);
      voti(myJSON);
    }
    
    var allvoti = [];
    function voti(Voti) {
      allvoti.push(Voti);
    }
    
  const data = {
    labels: labels,
    datasets: [{
      label: 'My First dataset',
      backgroundColor: [
        'rgb(255, 132, 0)'
      ],
      borderColor: 'rgb(255, 99, 132)',
      data: allvoti,
    }]
  };

The chart that I used is Chart.js.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!