Skip to content

Conversation

@benmccann
Copy link
Contributor

No description provided.

etimberg
etimberg previously approved these changes Nov 23, 2019
@benmccann benmccann requested a review from kurkle November 24, 2019 02:02
@kurkle
Copy link
Member

kurkle commented Nov 26, 2019

Is the order of ticks lost? Especially when majors are enabled.

@benmccann
Copy link
Contributor Author

Good catch @kurkle! I've updated it to address that

@kurkle
Copy link
Member

kurkle commented Nov 27, 2019

Wondering why its not catched by a test. I don't get your fix through.
Aren't all major ticks still going to be first in the array, followed by the minors?
Separating minor/major would solve it without sorting, but would be a big change.

@benmccann
Copy link
Contributor Author

Wondering why its not catched by a test.

Good question. There's a test in scale.time.tests called should handle autoskip with major and minor ticks that looks like it should catch it. Perhaps the assert library doesn't care about array order? There's no user-visible difference if ticks are plotted out-of-order, but I agree we should keep them in order anyway

I don't get your fix through. Aren't all major ticks still going to be first in the array, followed by the minors?

I don't think so. There's three cases in autoSkip:

  1. A subset of major ticks are displayed
  2. All major ticks and some minor ticks are displayed
  3. Only minor ticks are displayed

For 2, which it sounds like you're most worried about, skip is called once for each set of adjacent major ticks and it will add the major tick and following minor ticks. It doesn't operate on all major ticks first

@etimberg etimberg merged commit 090b5ae into chartjs:master Nov 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants