Skip to content

Use ticks.maxTicksLimit to limit gridLines in a similar way#1863

Merged
etimberg merged 5 commits intochartjs:v2.0-devfrom
morleyzhi:v2.0-dev
Jan 7, 2016
Merged

Use ticks.maxTicksLimit to limit gridLines in a similar way#1863
etimberg merged 5 commits intochartjs:v2.0-devfrom
morleyzhi:v2.0-dev

Conversation

@morleyzhi
Copy link

See #1859.

Right now, there's no way to limit the number of gridlines that appear if you've hidden ticks. This is what it looks like before this PR:

image

I made it so that if you provide maxTicksLimit, it limits gridLines, so now this graph will look like this:

image

Unlike maxTicksLimit, we don't default to 11 if the option isn't provided. I did this because it blew up the tests, and I didn't feel comfortable changing the test output and breaking people's setups. (But if you want me to preserve that 11-tick default behavior, it should be easy for me to do.)

I also added maxTicksLimit to scale docs, and some contributing notes.

👍

Morley Zhi added 5 commits January 7, 2016 10:44
…eOrDefault for resolving the maxTicksLimit option
(1) Only limit gridlines when maxTicksLimit is defined, so we don't blow up the tests.
(2) Add a note about running tests in CONTRIBUTING.md
(3) Rebuild files
etimberg added a commit that referenced this pull request Jan 7, 2016
Use ticks.maxTicksLimit to limit gridLines in a similar way
@etimberg etimberg merged commit 6f0d32f into chartjs:v2.0-dev Jan 7, 2016
@etimberg
Copy link
Member

etimberg commented Jan 7, 2016

Looks good. Thanks @morleyzhi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants