How to use a percentage scale with Chart.js

I tried to find it in the documentation (all the examples that I found elsewhere no longer work, perhaps due to outdated syntax for earlier versions) how to use "scaleLabel", but there it refers to the configuration of the scale header with a link that doesn't exist (anymore): http://www.chartjs.org/docs/#scale-title-configuration

Can someone provide a working example?

+4
source share
1 answer

The scale heading configuration is the heading if you scroll down in the documentation.

, scaleLabel, , .

https://jsfiddle.net/r71no58a/4/

scales: {
   yAxes: [{
       ticks: {
           min: 0,
           max: 100,
           callback: function(value) {
               return value + "%"
           }
       },
       scaleLabel: {
           display: true,
           labelString: "Percentage"
       }
   }]
}
+15

Source: https://habr.com/ru/post/1659387/


All Articles