stepSize is not working in chart js for line chart x-axis
See original GitHub issueI am using below option in chart :
option : {
scales: {
xAxes: [{
display: true,
scaleLabel: {
display: true,
labelString: 'fpr',
fontStyle: 'bold'
},
ticks: {
callback: function(value, index, values) {
return parseFloat(value).toFixed(2);
},
autoSkip: true,
maxTicksLimit: 10,
stepSize: .2
}
}],
yAxes: [{
display: true,
scaleLabel: {
display: true,
labelString: 'tpr',
fontStyle: 'bold'
},
ticks: {
callback: function(value, index, values) {
return parseFloat(value).toFixed(2);
},
autoSkip: true,
maxTicksLimit: 10,
stepSize: .2
}
}]
}
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:22 (9 by maintainers)
Top Results From Across the Web
Chart.js stepSize not working with min - Stack Overflow
This looks like a typo. In your snippet you have stepSize: 8 . Change it to stepSize: 7 and the scale works correctly....
Read more >How to Reduce the Label Ticks in the X Axis in Chart JS
The Chart JS documentation does not cover how to reduce the label ... bar chart or a line chart, or any type of...
Read more >How to Control Ticks Steps on the Y Scale in Chart js - YouTube
The default tick stepsize is not always the right structure for displaying ... With chart js you can make line chart, bar chart,...
Read more >How to set x-axis tick values for Charts.js line chart?
but it doesn't seem to make any difference. I've also tried changing the settings in Horizontal Axis Settings > Tick Settings, but they...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Also, the step size won’t work for the bottom because the default x axis is a ‘category’ axis that doesn’t interpolate numerically.
if you want to change that you can do
PS: why is this issue closed???