Using `stepSize` and `maxTicksLimit` together doesn't work.
See original GitHub issue- I have read the guidelines for contributing
- I have included an example of my issue on a website such as JS Bin, JS Fiddle, or Codepen. (Template)
I want to have a chart with a minimal stepSize
of 1
, basically I don’t want the steps to have decimals like 0.5 or something. I can set stepSize
to 1
, but then it will show a label for each step regardless of maxTicksLimit
.
You can see the problem here: http://codepen.io/anon/pen/pyBPME
If you disable the stepSize
option, the labels are fine, but if you then disable “dataset 1” and it only shows “dataset 2”, it will have steps like 0.5 and 1.5 which I don’t want.
Am I missing configuration or is this an issue?
Many thanks!
Issue Analytics
- State:
- Created 7 years ago
- Comments:26 (7 by maintainers)
Top Results From Across the Web
Chart.js divide stepSize in equal amount of steps
I think you can't use both maxTicksLimit and stepsize together. One way to solve it is to declare the data before the config...
Read more >Maxtickslimit Not Working In Reactchartjs2
Using stepSize and maxTicksLimit together doesn't work. Chart.js. Hello I'm building a line chart with a high number of data xAxes: [{ type:...
Read more >Getting Started With Chart.js: Axes and Scales - Code Tutsplus
The step size and the maximum number of ticks on the scale can be specified using the stepSize and maxTicksLimit keys. These options...
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 ticks ... The documentation makes it hard and the it is...
Read more >How to Add More Grid Lines in the Scales in Chart JS - YouTube
It requires a lot of different moving parts to work along. The canvas tag, javascript, arrays and Chart JS all need to be...
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 FreeTop 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
Top GitHub Comments
I think we can add a
minStepSize
option that works with the auto tick generation algorithm.@chris-wood-dynmark I think that would be supported with the
minStepSize
set to1
but I’ve edited my list above to include that requirement.I wrote that we should support it for both
minStepSize
andstepSize
though I kind of feel that it is more applicable tostepSize
only. Since it forces the stepSize to be a certain value, whileminStepSize
still runs the auto generate algorithm (which takes into accountmaxTicksLimit
) it might be odd to have it apply in that case since there are 2 variables for adjusting the step size.