]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Change default autoSkipPadding to 3 (#8629)
authorJukka Kurkela <jukka.kurkela@gmail.com>
Sat, 13 Mar 2021 18:30:19 +0000 (20:30 +0200)
committerGitHub <noreply@github.com>
Sat, 13 Mar 2021 18:30:19 +0000 (13:30 -0500)
docs/docs/axes/cartesian/_common_ticks.md
src/core/core.scale.js
test/specs/scale.time.tests.js

index 31ab2b9f195f3a80b2a9e924238a3294155afecd..1013844efbbb3058cf46e943ed8693f977d5e224 100644 (file)
@@ -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.*
index 1f413b5d999d0a988c8e40ddacf2994e36e6471d..19f1f26390eccc3de366239c1b82976c2f8dc788 100644 (file)
@@ -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,
index 9d0ed4a243f23622f0cfd3a2fa8c0fcd4c46752a..9309ffd2b2a8b8b80ab6435aa243ba11d2027d65 100644 (file)
@@ -1096,6 +1096,7 @@ describe('Time scale tests', function() {
             ticks: {
               source: 'data',
               autoSkip: true,
+              autoSkipPadding: 0,
               maxRotation: 0
             }
           },