SeanSobey / ChartjsNodeCanvas

A node renderer for Chart.js using canvas.
MIT License
228 stars 70 forks source link

Can't use Custom Font #146

Closed TonyKun7 closed 2 months ago

TonyKun7 commented 2 months ago

Versions


chartJsNode.registerFont('./src/assets/Montserrat.ttf', { family: 'Montserrat' });

const config = {
        type: 'line',
        data: {
            labels: [],
            datasets: []
        },
        options: {
            plugins: {
                legend: {
                    display: true,
                    position: 'bottom',
                    labels: {
                        color: 'white',
                        font: {
                            font: 'Montserrat'
                        }
                    }
                }
            }
        }
};