0

enter image description here

I am trying to add the Chartjs in my angular application. it's not loading the lowest value in the graph

my code

<canvas id="myChart" width="100" height="100" ng-if=""></canvas>

 var ctx = document.getElementById('myChart');
var myChart = new Chart(ctx, {
  type: 'bar',
  data: {
    datasets: [{
      label: 'Applied',
      data: [10, 20, 30],
      backgroundColor: 'rgb(66, 158, 244)'
    }, {
        label: 'Separated',
        data: [20, 40, 15],
        backgroundColor: 'rgb(193, 27, 71)'
    }],
    labels: ['January', 'February', 'March']
  },

  // Configuration options go here
  options: {}
});
1
  • 1
    Can u create a demo example on plunkr.com and let me know Commented Apr 9, 2019 at 11:04

1 Answer 1

1

I think its because of the y-axis value got aligned with the data value (10 in this sample) and this made the bar invisible there. Can you try by specifying the y-axis ticks for the chart options as follows?

options: {
    scales: {
        yAxes: [{
            ticks: {
                min: 0,
                stepSize: 5,
            }
        }]
    }
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.