I'm trying to make a horizontal bar chart with an integer scale.
As suggested in this question, I've tried to set scaleOverride
, scaleSteps
etc, but it seems not to be working. I tried to put them in dataset, in options, in xScales but nothing worked.
This jsfiddle shows what I tried to do.
The Utils file contains multiple helper functions that the chart. js sample pages use to generate charts. These functions are subject to change, including but not limited to breaking changes without prior notice. Because of this please don't rely on this file in production environments.
With ChartJS 3, you can change the color of the labels by setting the scales. x. ticks. color and scales.
The linked question is for Chart.js version 1.x. For the new version you need to use the ticks
option. See http://www.chartjs.org/docs/#scales
...
xAxes: [{
ticks: {
min: 0,
stepSize: 1,
max: 4
},
...
Fiddle - https://jsfiddle.net/jkufz1b9/
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