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

227
Views
Javascript: cómo eliminar un objeto nulo en el gráfico JS

Necesito eliminar un objeto con un valor nulo de mi tablero y no lo estoy logrando. Usé la función SkipNull, y aún así mi gráfico de barras tiene un espacio en blanco vacío. ¿Me puedes ayudar? ¿Hay alguna forma de hacer esto?

Mi gráfico:

 this.chart = new Chart('canvas', { type: 'bar', data: { labels: this.serverName, datasets: [ { data: this.serverMemory, borderColor: 'transparent', label: 'Full Memory', backgroundColor: '#007bff', borderWidth: 3, borderRadius: 10, }, { data: this.serverMemoryUnused, borderColor: 'transparent', label: 'Memory Unused', backgroundColor: '#e3ebf6', borderWidth: 3, borderRadius: 10, }, ], }, options: { skipNull: true, scales: { x: { display: true, }, y: { beginAtZero: true, ticks: { callback: (label: any) => `${label * (1048576 / 1000000000)} GB` }, grid: { display: false } }, } } });

Mi carga útil:

 [{ memory: 10, unused_memory: 20 }, { memory: 10, unused_memory: 20 }, { memory: 10, unused_memory: null } ]

Resultado

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!