3๐
โ
It worked by changing my extender function as follows.
Model:
barModel = new BarChartModel();
barModel.setExtender("skinBar");
Extender function:
function skinBar() {
Chart.defaults.global.defaultFontFamily = 'Tahoma';
}
reference: https://www.chartjs.org/docs/latest/general/fonts.html
0๐
If you canโt, or donโt want to use an extender function, you can add this to the bottom of your template (before </body>
):
<script>if(typeof Chart!=='undefined'){Chart.defaults.font.family='...'}</script>
It will apply if any charts are visible at the moment the page is rendered. So not perfect, and I suggest to use the extender instead when possible.
Source:stackexchange.com