Stripped personal data from development repository
Samo Penic
2019-02-20 83c3f647c35477564b77cbc5b36d37d793d5442a
commit | author | age
83c3f6 1 # Fonts
SP 2
3 There are 4 special global settings that can change all of the fonts on the chart. These options are in `Chart.defaults.global`. The global font settings only apply when more specific options are not included in the config.
4
5 For example, in this chart the text will all be red except for the labels in the legend.
6
7 ```javascript
8 Chart.defaults.global.defaultFontColor = 'red';
9 let chart = new Chart(ctx, {
10     type: 'line',
11     data: data,
12     options: {
13         legend: {
14             labels: {
15                 // This more specific font property overrides the global property
16                 fontColor: 'black'
17             }
18         }
19     }
20 });
21 ```
22
23 | Name | Type | Default | Description
24 | ---- | ---- | ------- | -----------
25 | `defaultFontColor` | `Color` | `'#666'` | Default font color for all text.
26 | `defaultFontFamily` | `String` | `"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"` | Default font family for all text.
27 | `defaultFontSize` | `Number` | `12` | Default font size (in px) for text. Does not apply to radialLinear scale point labels.
28 | `defaultFontStyle` | `String` | `'normal'` | Default font style. Does not apply to tooltip title or footer. Does not apply to chart title.
29
30 ## Non-Existant Fonts
31
32 If a font is specified for a chart that does exist on the system, the browser will not apply the font when it is set. If you notice odd fonts appearing in your charts, check that the font you are applying exists on your system. See [issue 3318](https://github.com/chartjs/Chart.js/issues/3318) for more details.