hello I’m the beginner of making a webpage. I just used the template which I downloaded at Internet and changed a little.
Actually I’m Korean. so I used korean at my pages. but only the tooltip part was garbled.
enter image description here
Here is my PieChart.js. and I’m also using .net core MVC.
var ctx = document.getElementById("myPieChart");
var myPieChart = new Chart(ctx, {
type: 'doughnut',
data: {
labels: ["전체 수량", "완료량"],
datasets: [{
data: [116, 256],
backgroundColor: ['#4e73df', '#1cc88a'/*, '#36b9cc'*/],
hoverBackgroundColor: ['#2e59d9', '#17a673'/*, '#2c9faf'*/],
hoverBorderColor: "rgba(234, 236, 244, 1)",
}],
},
options: {
maintainAspectRatio: false,
tooltips: {
titleFontFamily: "'맑은 고딕', 'Arial', sans-serif",
bodyFontFamily: "'맑은 고딕', 'Arial', sans-serif",
backgroundColor: "rgb(255,255,255)",
bodyFontColor: "#858796",
borderColor: '#dddfeb',
borderWidth: 1,
xPadding: 15,
yPadding: 15,
displayColors: false,
caretPadding: 10,
callbacks: {
label: function (tooltipItem, data) {
var label = data.labels[tooltipItem.index] || '';
var value = data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index];
return label+': ' +value+ '개'
}
}
},
legend: {
display: false
},
cutoutPercentage: 80,
},
});
1.I tried to put tag in HTML file.
-
and also change the font that is suitable for korean language.
options: {
maintainAspectRatio: false,
tooltips: {
titleFontFamily: “‘맑은 고딕’, ‘Arial’, sans-serif”,
bodyFontFamily: “‘맑은 고딕’, ‘Arial’, sans-serif”,
BJH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.