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

174
Views
Diagrama de dispersión que no muestra nada chartjs necesita algo de depuración

 var ctx = document.getElementById("myChart"); var myChart = new Chart(ctx, { "type": "scatter", "data": { "datasets": [ { "label": "EARRINGS", "data": [ { "x": 13, "y": "19-07-2021" }, { "x": 5, "y": "12-08-2021" } ], "showLine": true, "fill": false, "borderColor": "rgb(125,60,122)" }, { "label": "RINGS", "data": [ { "x": 4, "y": "09-08-2021" }, { "x": 1, "y": "06-08-2021" }, { "x": 9, "y": "12-08-2021" } ], "showLine": true, "fill": false, "borderColor": "rgb(125,60,122)" }, { "label": "BANGLES", "data": [ { "x": 2, "y": "06-08-2021" }, { "x": 1, "y": "12-08-2021" } ], "showLine": true, "fill": false, "borderColor": "rgb(125,60,122)" }, { "label": "NECKLACES", "data": [ { "x": 1, "y": "12-08-2021" } ], "showLine": true, "fill": false, "borderColor": "rgb(125,60,122)" } ] }, "options": { "scales": { "x": { "title": { "display": true, "text": "Date" }, "ticks": { "precision": 0, "maxTicksLimit": 9 } }, "y": { "title": { "display": true, "text": "No of Trials" }, "ticks": { "precision": 0 } } } } });
 <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.2/Chart.min.js"></script> <canvas id="myChart"></canvas>

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

2 cosas, no use una versión desactualizada de lib ya que su configuración no funcionará y la escala y es una escala lineal de forma predeterminada, por lo que si desea usar cadenas, debe especificarla como una escala de categoría

 var ctx = document.getElementById("myChart"); var myChart = new Chart(ctx, { "type": "scatter", "data": { "datasets": [ { "label": "EARRINGS", "data": [ { "x": 13, "y": "19-07-2021" }, { "x": 5, "y": "12-08-2021" } ], "showLine": true, "fill": false, "borderColor": "rgb(125,60,122)" }, { "label": "RINGS", "data": [ { "x": 4, "y": "09-08-2021" }, { "x": 1, "y": "06-08-2021" }, { "x": 9, "y": "12-08-2021" } ], "showLine": true, "fill": false, "borderColor": "rgb(125,60,122)" }, { "label": "BANGLES", "data": [ { "x": 2, "y": "06-08-2021" }, { "x": 1, "y": "12-08-2021" } ], "showLine": true, "fill": false, "borderColor": "rgb(125,60,122)" }, { "label": "NECKLACES", "data": [ { "x": 1, "y": "12-08-2021" } ], "showLine": true, "fill": false, "borderColor": "rgb(125,60,122)" } ] }, "options": { "scales": { "x": { "title": { "display": true, "text": "Date" }, "ticks": { "precision": 0, "maxTicksLimit": 9 } }, "y": { type: 'category', "title": { "display": true, "text": "No of Trials" }, "ticks": { "precision": 0 } } } } });
 <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.5.1/chart.js"></script> <canvas id="myChart"></canvas>

about 4 years ago · Juan Pablo Isaza Report
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!