Skip to content

Commit

Permalink
Change default autoSkipPadding to 3 (#8629)
Browse files Browse the repository at this point in the history
  • Loading branch information
kurkle authored Mar 13, 2021
1 parent 6ac89cb commit a026b60
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/docs/axes/cartesian/_common_ticks.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Namespace: `options.scales[scaleId].ticks`
| `crossAlign` | `string` | `'near'` | The tick alignment perpendicular to the axis. Can be `'near'`, `'center'`, or `'far'`. See [Tick Alignment](./index#tick-alignment)
| `sampleSize` | `number` | `ticks.length` | The number of ticks to examine when deciding how many labels will fit. Setting a smaller value will be faster, but may be less accurate when there is large variability in label length.
| `autoSkip` | `boolean` | `true` | If true, automatically calculates how many labels can be shown and hides labels accordingly. Labels will be rotated up to `maxRotation` before skipping any. Turn `autoSkip` off to show all labels no matter what.
| `autoSkipPadding` | `number` | `0` | Padding between the ticks on the horizontal axis when `autoSkip` is enabled.
| `autoSkipPadding` | `number` | `3` | Padding between the ticks on the horizontal axis when `autoSkip` is enabled.
| `labelOffset` | `number` | `0` | Distance in pixels to offset the label from the centre point of the tick (in the x-direction for the x-axis, and the y-direction for the y-axis). *Note: this can cause labels at the edges to be cropped by the edge of the canvas*
| `maxRotation` | `number` | `50` | Maximum rotation for tick labels when rotating to condense labels. Note: Rotation doesn't occur until necessary. *Note: Only applicable to horizontal scales.*
| `minRotation` | `number` | `0` | Minimum rotation for tick labels. *Note: Only applicable to horizontal scales.*
Expand Down
2 changes: 1 addition & 1 deletion src/core/core.scale.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ defaults.set('scale', {
padding: 0,
display: true,
autoSkip: true,
autoSkipPadding: 0,
autoSkipPadding: 3,
labelOffset: 0,
// We pass through arrays to be rendered as multiline labels, we convert Others to strings here.
callback: Ticks.formatters.values,
Expand Down
1 change: 1 addition & 0 deletions test/specs/scale.time.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,7 @@ describe('Time scale tests', function() {
ticks: {
source: 'data',
autoSkip: true,
autoSkipPadding: 0,
maxRotation: 0
}
},
Expand Down

0 comments on commit a026b60

Please sign in to comment.