-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use maxTicksLimit option to calculate the labels size on ticks (#11069)
* Use maxTicksLimit option to calculate the labels size on ticks * apply review
- Loading branch information
1 parent
1db46ef
commit 8dfcf1c
Showing
3 changed files
with
43 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
37 changes: 37 additions & 0 deletions
37
test/fixtures/scale.category/max-ticks-limit-norotation.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
const data = Array.from({length: 42}, (_, i) => i + 1); | ||
const labels = data.map(v => 'tick' + v); | ||
|
||
module.exports = { | ||
description: 'https://github.com/chartjs/Chart.js/issues/10856', | ||
config: { | ||
type: 'bar', | ||
data: { | ||
datasets: [{ | ||
data | ||
}], | ||
labels | ||
}, | ||
options: { | ||
scales: { | ||
x: { | ||
ticks: { | ||
display: true, | ||
maxTicksLimit: 6 | ||
}, | ||
grid: { | ||
color: 'red' | ||
} | ||
}, | ||
y: {display: false} | ||
}, | ||
layout: { | ||
padding: { | ||
right: 2 | ||
} | ||
} | ||
} | ||
}, | ||
options: { | ||
spriteText: true | ||
} | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.