From: Jukka Kurkela Date: Sat, 13 Mar 2021 18:30:19 +0000 (+0200) Subject: Change default autoSkipPadding to 3 (#8629) X-Git-Tag: v3.0.0-beta.14~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a026b6065324fe8967de7789b091996a30557ed6;p=thirdparty%2FChart.js.git Change default autoSkipPadding to 3 (#8629) --- diff --git a/docs/docs/axes/cartesian/_common_ticks.md b/docs/docs/axes/cartesian/_common_ticks.md index 31ab2b9f1..1013844ef 100644 --- a/docs/docs/axes/cartesian/_common_ticks.md +++ b/docs/docs/axes/cartesian/_common_ticks.md @@ -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.* diff --git a/src/core/core.scale.js b/src/core/core.scale.js index 1f413b5d9..19f1f2639 100644 --- a/src/core/core.scale.js +++ b/src/core/core.scale.js @@ -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, diff --git a/test/specs/scale.time.tests.js b/test/specs/scale.time.tests.js index 9d0ed4a24..9309ffd2b 100644 --- a/test/specs/scale.time.tests.js +++ b/test/specs/scale.time.tests.js @@ -1096,6 +1096,7 @@ describe('Time scale tests', function() { ticks: { source: 'data', autoSkip: true, + autoSkipPadding: 0, maxRotation: 0 } },