Created logarithmic chart using:
options = {
scales: {
xAxes: [{
type: 'linear',
position: 'bottom'
}],
yAxes: [{
type: 'logarithmic',
position: 'left'
}]
}
}
This automatically changes the axis values to scientific format. (I don’t think this is desired behavior.) I searched through the docs and could not figure out how to set the axis values to regular format (i.e. 100000). Or even better: 100,000.
Googling I found the custom Javascript formatter callback function, but that doesn’t seem like a good solution.
How to set the axis values (labels) format?
OK, thanks for the help.
It seems that this will convert to a more human readable format:
In the current version of ChartJS you loose the log scale, with this implementation all works as expected.
Hi! The above worked great for me, except that I had to change this line:
with
So ChartJS is replaced with Chart (took me a short while to figure it out, I hope this helps others).
In Chart.js 3.0 the log chart no longer defaults to scientific format