How to set max and min value for Y axis

后端 未结 17 2115
既然无缘
既然无缘 2020-11-27 11:08

I am using line chart from http://www.chartjs.org/ \"enter

As you can see max value (1

17条回答
  •  忘掉有多难
    2020-11-27 11:34

    In my case, I used a callback in yaxis ticks, my values are in percent and when it reaches 100% it doesn't show the dot, I used this :

          yAxes: [{
                       ticks: {
                           beginAtZero: true,
                           steps: 10,
                           stepValue: 5,
                           min: 0,
                           max: 100.1,
                           callback: function(value, index, values) {
                               if (value !== 100.1) {
                                   return values[index]
                               }
                           }
                       }
                   }],
    

    And it worked well.

提交回复
热议问题