Я создал гистограмму с помощью библиотеки ChartJs 2.6.0 (https://www.chartjs.org/). Проблема в том, что при попытке преобразовать страницу в PDF с помощью WkHTMLToPDF.exe создается пустая страница.
Есть предложения?
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.6.0/Chart.min.js"></script>
</head>
<body>
<div style="width: 400px; height: 400px;">
<canvas id="canvas2" style="width: 400px; height: 400px;">
</canvas>
</div>
<script type="text/javascript">
// Bar chart
function showImg() {
new Chart(document.getElementById("canvas2"), {
type: 'bar',
data: {
labels: ["Africa", "Asia", "Europe", "Latin America", "North America"],
datasets: [
{
label: "Population (millions)",
backgroundColor: ["#3e95cd", "#8e5ea2", "#3cba9f", "#e8c3b9", "#c45850"],
data: [2478, 5267, 734, 784, 433]
}
]
},
options: {
legend: { display: false },
title: {
display: true,
text: 'Predicted world population (millions) in 2050'
},
responsive: false,
responsiveAnimationDuration: 0,
animation: { duration: 0 }
}
});
showImg();
</script>