| 1 | import Ticks from './core.ticks.js'; |
| 2 | |
| 3 | export function applyScaleDefaults(defaults) { |
| 4 | defaults.set('scale', { |
| 5 | display: true, |
| 6 | offset: false, |
| 7 | reverse: false, |
| 8 | beginAtZero: false, |
| 9 | |
| 10 | /** |
| 11 | * Scale boundary strategy (bypassed by min/max time options) |
| 12 | * - `data`: make sure data are fully visible, ticks outside are removed |
| 13 | * - `ticks`: make sure ticks are fully visible, data outside are truncated |
| 14 | * @see https://github.com/chartjs/Chart.js/pull/4556 |
| 15 | * @since 3.0.0 |
| 16 | */ |
| 17 | bounds: 'ticks', |
| 18 | |
| 19 | clip: true, |
| 20 | |
| 21 | /** |
| 22 | * Addition grace added to max and reduced from min data value. |
| 23 | * @since 3.0.0 |
| 24 | */ |
| 25 | grace: 0, |
| 26 | |
| 27 | // grid line settings |
| 28 | grid: { |
| 29 | display: true, |
| 30 | lineWidth: 1, |
| 31 | drawOnChartArea: true, |
| 32 | drawTicks: true, |
| 33 | tickLength: 8, |
| 34 | tickWidth: (_ctx, options) => options.lineWidth, |
| 35 | tickColor: (_ctx, options) => options.color, |
| 36 | offset: false, |
| 37 | }, |
| 38 | |
| 39 | border: { |
| 40 | display: true, |
| 41 | dash: [], |
| 42 | dashOffset: 0.0, |
| 43 | width: 1 |
| 44 | }, |
| 45 | |
| 46 | // scale title |
| 47 | title: { |
| 48 | // display property |
| 49 | display: false, |
| 50 | |
| 51 | // actual label |
| 52 | text: '', |
| 53 | |
| 54 | // top/bottom padding |
| 55 | padding: { |
| 56 | top: 4, |
| 57 | bottom: 4 |
| 58 | } |
| 59 | }, |
| 60 | |