Change ticks.mode to scale.distribution#4582
Merged
simonbrunel merged 1 commit intochartjs:masterfrom Jul 30, 2017
Merged
Conversation
benmccann
reviewed
Jul 29, 2017
src/scales/scale.time.js
Outdated
|
|
||
| var table = []; | ||
| var items = timestamps.slice(0); | ||
| var items = []; |
Contributor
There was a problem hiding this comment.
should you just make this var items = [min]; and avoid the need for items.push(min) below?
benmccann
reviewed
Jul 29, 2017
src/scales/scale.time.js
Outdated
| me._datasets = datasets; | ||
| me._horizontal = me.isHorizontal(); | ||
| me._labels = labels.sort(sorter); // Sort labels **after** data have been converted | ||
| me._timestamps = timestamps; |
Contributor
There was a problem hiding this comment.
I might call this _dataTimestamps to distinguish from ticks and labels
Member
Author
There was a problem hiding this comment.
_data then to be consistent with _labels and _datasets
Contributor
There was a problem hiding this comment.
It's not all the data though (just the timestamps), so I think that might make it harder to read. Maybe _dataMillis, _labelMillis, and _datasetMillis ?
Contributor
|
lgtm |
Contributor
|
thank you for this!! |
Fix `ticks.mode` behavior when `ticks.source` is `auto`: the lookup table is now built from the data and not from the ticks, so data (and ticks) are correctly distributed along the scale. Rename the option to `distribution` (more explicit than `mode`) and since this option applies from now on the data, it seems better to have it under `scale` instead `scale.ticks`.
d86cc9c to
85c59c5
Compare
etimberg
approved these changes
Jul 30, 2017
yofreke
pushed a commit
to yofreke/Chart.js
that referenced
this pull request
Dec 30, 2017
Fix `ticks.mode` behavior when `ticks.source` is `auto`: the lookup table is now built from the data and not from the ticks, so data (and ticks) are correctly distributed along the scale. Rename the option to `distribution` (more explicit than `mode`) and since this option applies from now on the data, it seems better to have it under `scale` instead `scale.ticks`.
exwm
pushed a commit
to exwm/Chart.js
that referenced
this pull request
Apr 30, 2021
Fix `ticks.mode` behavior when `ticks.source` is `auto`: the lookup table is now built from the data and not from the ticks, so data (and ticks) are correctly distributed along the scale. Rename the option to `distribution` (more explicit than `mode`) and since this option applies from now on the data, it seems better to have it under `scale` instead `scale.ticks`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix
ticks.modebehavior whenticks.sourceisauto: the lookup table is now built from the data and not from the ticks, so data (and ticks) are correctly distributed along the scale. Rename the option todistribution(more explicit thanmode) and since this option applies from now on the data, it seems better to have it underscaleinsteadscale.ticks.Related to #4507
@benmccann