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

612
Views
charts not showing properly in angular - Chart.js

In my component, I have 6 charts that I display via ngFor and the data I get it from Firebase, let me show you:

component.html

<div style="width: 550px; border-radius: 8px;"
         class="animacion mb-5 mat-elevation-z7 animate__animated animate__fadeInRight"
         [ngClass]="'animate__delay-'+i+'s'" *ngFor="let gerencia of arregloGerencias; let i = index">
            <div class="text-center mt-3">
                <h4>{{gerencia.nombre | titlecase}}</h4>

            </div>
            <hr>
            <canvas class="mb-5" baseChart (chartClick)="chartClicked($event)"
            [data]="arregloGrafico[i]" [labels]=" polarAreaChartLabels"
            [legend]="polarAreaLegend " [chartType]="polarAreaChartType ">

            </canvas>
        </div>

component.ts

for ( let i = 0; i < this.arregloGerencias.length; i++) {
                  let contadorListo = 0;
                  let contadorNoListo = 0;
                  for (let j = 0; j < arregloFinal.length; j++) {
                    if (arregloFinal[j].areaAux.gerencia == this.arregloGerencias[i].nombre) {
                      if (arregloFinal[j].marcador) {
                        contadorListo ++
                      } else  {
                        contadorNoListo ++
                      }
                    }
                  }
                  this.arregloGrafico.push([contadorListo, contadorNoListo]);
                  
                }

I use and array of arrays of numbers to get the data of every chart that is displayed, as you can see in the part of canvas [data]="arregloGrafico[i]" and this is what I've got:

It shows only the last two

As you can see, it only shows the last two charts properly and I don't know why that happens. What I've realized, is that the output is correct but the last two arrays shows different: enter image description here

Please help !!

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!