@darrion.kuhn
To add a custom Arabic and Persian font to Chart.js, follow these steps:
1 2 3 4 |
@font-face {
font-family: 'customFont';
src: url('customFont.ttf') format('truetype');
}
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
options: {
scales: {
yAxes: [{
ticks: {
fontFamily: "customFont",
}
}],
xAxes: [{
ticks: {
fontFamily: "customFont",
}
}]
}
}
|
1 2 3 4 5 6 7 8 |
options: {
title: {
display: true,
text: 'أهلا وسهلا',
fontSize: 18,
fontFamily: 'customFont'
}
}
|
After following these steps, your Chart.js charts should now be using the custom Arabic and Persian font you added.