* Fix autoSkip
* Add tests
*/
_autoSkip(ticks) {
const me = this;
- const tickOpts = me.options.ticks;
- const ticksLimit = tickOpts.maxTicksLimit || me._length / me._tickSize();
+ const {offset, ticks: tickOpts} = me.options;
+ const ticksLimit = tickOpts.maxTicksLimit || (me._length / me._tickSize() + (offset ? 0 : 1));
const majorIndices = tickOpts.major.enabled ? getMajorIndices(ticks) : [];
const numMajorIndices = majorIndices.length;
const first = majorIndices[0];
--- /dev/null
+module.exports = {
+ description: 'https://github.com/chartjs/Chart.js/issues/8611',
+ config: {
+ type: 'line',
+ data: {
+ labels: ['Red Red Red', 'Blue Blue Blue', 'Black Black Black', 'Pink Pink Pink'],
+ datasets: [
+ {
+ label: '# of Votes',
+ data: [12, 19, 3, 5]
+ },
+ ]
+ },
+ },
+ options: {
+ spriteText: true,
+ canvas: {
+ width: 470,
+ height: 128
+ }
+ }
+};
--- /dev/null
+module.exports = {
+ description: 'https://github.com/chartjs/Chart.js/issues/8611',
+ config: {
+ type: 'bar',
+ data: {
+ labels: ['Red Red Red', 'Blue Blue Blue', 'Black Black Black', 'Pink Pink Pink'],
+ datasets: [
+ {
+ label: '# of Votes',
+ data: [12, 19, 3, 5]
+ },
+ ]
+ },
+ },
+ options: {
+ spriteText: true,
+ canvas: {
+ width: 506,
+ height: 128
+ }
+ }
+};