Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

224
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda