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

178
Views
How to update Apexchart chart with loop for date? [tutorial]

I found solution to make a loop in ApexChart which I want to share with you. First, you should name your chart with id


chart {...
id: 'chart1',
...},

Second, you should make a global var just like ptr = []

Third step is to push there date.

var wynik4 =  
(function  () {
for(i=0; i<str.length - 1; i++){
r =    r + str[i];
ptr.push(r.toFix(1));
}})();

Finally, you should update your chart with new dates using special formula.

function c() {
  ApexCharts.exec('chart1', "updateOptions", {
    xaxis: {
    
      categories: ptr,
    }
  });

  ApexCharts.exec('chart1', "updateSeries", [
    {
    name: 'xyz',  data: ptr,
    }
  ]);
}


That's all, so simple.

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!