question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using `stepSize` and `maxTicksLimit` together doesn't work.

See original GitHub issue

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:closed
  • Created 7 years ago
  • Comments:26 (7 by maintainers)

github_iconTop GitHub Comments

18reactions
etimbergcommented, Jun 20, 2016

I think we can add a minStepSize option that works with the auto tick generation algorithm.

3reactions
etimbergcommented, Jan 10, 2017

@chris-wood-dynmark I think that would be supported with the minStepSize set to 1 but I’ve edited my list above to include that requirement.

I wrote that we should support it for both minStepSize and stepSize though I kind of feel that it is more applicable to stepSize only. Since it forces the stepSize to be a certain value, while minStepSize still runs the auto generate algorithm (which takes into account maxTicksLimit) it might be odd to have it apply in that case since there are 2 variables for adjusting the step size.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found