-
Notifications
You must be signed in to change notification settings - Fork 11.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ticks callback have unexpected behavior #1800
Comments
There is an auto skipper. Shouldn't be too difficult to disable in this case. |
Yeah. If you have implemented a callback you probably don't want the auto skipper so it could probably be disabled in that case. Another option is an autoSkipper true/false. |
Oh, just noticed the Maybe it isn't supposed to be used as I did it though. I simply filtered afterBuildTicks: function() {
var everyX = (Math.ceil((this.ticks.length/2)/10)*10);
this.ticks = _.filter(this.ticks, function (tick, index) {
if (index === 1 || index === this.ticks.length - 1 ) {
return true;
}
return index % everyX === 0;
}.bind(this));
} |
Closing since #1810 was merged |
As I mentioned here #1021 (comment).
I think the ticks callback have som unexpected behavior.
Let's say I want to show every X label, with something like:
On some screen sizes it does what expected and in some not.
I guess the algorithm that automatically skips some labels interfere with the callback.
If I'm not mistaken that algorithm counts against the whole ticks array and not the actual showed one?
I have a graph with over 300 data points and want to show 3-5 labels and it really isn't possible with the callback.
Example.
I can live with this many labels
but on a small screen it only showing one:
Even more clear when it shows only one here:
but a little smaller screen and it shows four:
Not a big problem for me since I already have my own custom scale and can implement the afterBuildTicks hook and simply filter the ticks array, but it probably should be fixed.
JsFiddle for the example:
https://jsfiddle.net/olyckne/7ycm5bjg/10/
The text was updated successfully, but these errors were encountered: