0š
Plz see HTML canvas font Property.
The JavaScript syntax: context.font=āitalic small-caps bold 12px arialā;
Reference: https://www.w3schools.com/tags/canvas_font.asp
In your case just replace:
let ctx = chart.chart.ctx;
let fontSize = (height / 100).toFixed(2);
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
ctx.font = "bold " + fontSize + "em Montserrat";
- [Chartjs]-Angular-chart.js ā Make line chart does not curve
- [Chartjs]-How to fix chart Legends width-height with overflow scroll in ChartJS
Source:stackexchange.com