Hi Team,
Could you please confirm the version of Chart.js supported by Koolreport? Version 2.2.1 is working for us, but when we upgrade to Chart.js version 4.4.7, the charts don't render in the report, even though the same code works fine in an HTML file.
<div style="border:1px solid #cccccc; padding:10px 5px;">
<canvas id="myChart1" width="400" height="300"></canvas>
</div>
<script>
const data = {
labels: ['Red', 'Blue', 'Yellow'],
datasets: [{
label: 'My First Dataset',
data: [300, 50, 100],
backgroundColor: [
'rgb(255, 99, 132)', // Red
'rgb(54, 162, 235)', // Blue
'rgb(255, 205, 86)' // Yellow
]
}]
};
const config = {
type: 'pie',
data: data,
options: {
animation: {
duration: 0 // Set animation duration to 0 to disable animation
}
}
};
const ctx = document.getElementById('myChart1').getContext('2d');
new Chart(ctx, config);
</script>