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

233
Views
I want to create graph with Chart.js but not getting as i want

I want to create graph with Chart.js but not getting success as i want. In x axis i want interval of 5 like 5,10,15... etc and Y axis as interval of 2 like 2,4,6,..... etc

I am trying below code but not getting success

<div>  <canvas id="chartJSContainer" style="width:800px"></canvas>

My js script like this

    <script>

var options = {
      type: 'bar',
      data: {
        labels: ["05", "10", "15", "20", "25", "30"],
        datasets: [{
            label: 'Total Purchase',
            data: [12, 19, 3, 5],
            borderWidth: 1,
            backgroundColor: 'red'
          },
          {
            label: 'Total Purchase',
            data: [7, 11, 5, 8],
            borderWidth: 1,
            backgroundColor: 'yellow'
          },
          {
            label: 'Total Purchase',
            data: [10, 15, 10, 5],
            borderWidth: 1,
            backgroundColor: 'orange'
          },
          {
            label: 'Total Purchase',
            data: [10, 15, 10, 5],
            borderWidth: 1,
            backgroundColor: 'pink'
          }
        ]
      },
      options: {
        scales: {
          yAxes: [{
            ticks: {
              reverse: false
            }
          }]
        }
      }
    }
    
    var ctx = document.getElementById('chartJSContainer').getContext('2d');
    new Chart(ctx, options);
        </script>

Please check attached Images like that i want to create graph enter image description here

If anyone have idea what is wrong in that then please let me know

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!