20

I tried to look it up in the documentation (all examples I found elsewhere did not work anymore, probably due to an outdated syntax for earlier versions) how to use "scaleLabel", but there it references to the scale title configuration with a link which does not exist (anymore): http://www.chartjs.org/docs/#scale-title-configuration

Can someone please provide a working example?

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
Simon Ferndriger
  • 4,455
  • 6
  • 28
  • 53

1 Answers1

60

Scale title configuration is a header if you scroll down in the documentation.

Here is a simple bar chart example, using scaleLabel which is sligtly modified to illustrate a percentage.

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

scales: {
   yAxes: [{
       ticks: {
           min: 0,
           max: 100,
           callback: function(value) {
               return value + "%"
           }
       },
       scaleLabel: {
           display: true,
           labelString: "Percentage"
       }
   }]
}
Tom Glover
  • 2,996
  • 23
  • 23
  • Can i scale polar chart scales area by index? Imagine i have 36 and 2 values, 36 scales big and 2 very small. @tom-glover – KOMODO Apr 28 '22 at 13:43
  • maybe, I haven't worked with JS or Chart.js in years, id suggest clarify the question a bit, maybe draw an example and ask it as a stack overflow question (https://stackoverflow.com/questions/ask). @KOMODO – Tom Glover May 03 '22 at 09:38