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

179
Views
¿Cómo puedo eliminar marcas específicas y reorganizar el gráfico? Por favor la imagen adjunta

Soy nuevo en ChartJS y trato de modificar el gráfico. Eliminé marcas específicas del eje Y usando la función de devolución de llamada, pero obtuve espacio entre las marcas restantes, pero quiero reorganizar el gráfico con el mismo ancho entre las marcas.

Resultado Esperado

ingrese la descripción de la imagen aquí

Aquí está el violín de muestra que probé.

¿Alguien me puede ayudar?

 var data = [{ x: 0, y: 10 }, { x: 2, y: 10 }, { x: 6, y: 10 }, { x: 10, y: 50 }]; var labels_x = [1.6666666666666665, 9.666666666666666, 17.666666666666668, 25.666666666666668, 33.666666666666664, 41.666666666666664, 49.666666666666664, 57.666666666666664] // note computed values not integer var labels = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun', 'Mon'] var options = { type: 'line', data: { datasets: [{ data: data }, ] }, options: { scales: { yAxes: [{ ticks: { min: 0, callback(value, index) { if (value != 20 && value != 25) { return value; } console.log("val::::::::", value) } } }], xAxes: [{ type: 'linear', ticks: { min: 0, max: 61, autoSkip: false, callback(value, index) { return labels[index]; } }, afterBuildTicks(scale) { return labels_x; } }] } } } var ctx = document.getElementById('chartJSContainer').getContext('2d'); new Chart(ctx, options);
 canvas { background-color: #eee; }
 <body> <canvas id="chartJSContainer" width="600" height="300"></canvas> </body> <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.min.js"></script>

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!