Fonts
Chart.js uses Canvas to select and display local and installed fonts. The font configuration involves setting up to four font properties: family, size, style, and color. A fontFamily
is a string containing a list of font-family names, a fontStyle
contains a string with the name of a style supported by the corresponding font-family, a fontColor
is any valid CSS-compatible color string, and the fontSize
is a number that represents the size in pixels. You can configure font attributes in any object that includes text: titles, tick captions, legend labels, or tooltips, or you can set global defaults that will be inherited by text elements that don't explicitly set font attributes.
Selecting standard fonts
The basic font properties are named fontFamily
, fontSize
, fontStyle
, and fontColor
. Some objects have prefixed versions of these same properties. These objects are listed as follows:
Object containing text element | Description | Font properties |
| Global defaults |
|