I am trying to adjust the scales on my yAxes and cannot find any information that isn't outdated.
Basically, I want my yAxes to go from 0 - 100 with steps of 25.
https://codepen.io/brycesnyder/pen/wmJKyv
yAxes: [
{
ticks: {
beginAtZero: true,
steps: 10,
stepValue: 10,
max: 100
}
}
]
To set the chart size in ChartJS, we recommend using the responsive option, which makes the Chart fill its container. You must wrap the chart canvas tag in a div in order for responsive to take effect. You cannot set the canvas element size directly with responsive .
However, as your data visualization and customization needs grow — the more you'll benefit from getting under the hood of ChartJS. We can refer directly to the ChartJS documentation and customize as much as we need.
With ChartJS 3, you can change the color of the labels by setting the scales. x. ticks. color and scales.
To do this, change stepValue: 10
to stepSize: 25
, and remove steps: 10,
.
See chart.js docs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With