Closed gyto23 closed 3 years ago
The cause of this issue is described in #13 and fixed in #14. Here is the code to reproduce the behavior:
<html>
<head>
<meta charset="UTF-8">
<title>Test</title>
</head>
<body>
<canvas id="chart1"></canvas>
<script src="https://cdn.jsdelivr.net/npm/chart.js@2"></script>
<script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-deferred@1"></script>
<script type="module">
const chart1 = document.getElementById('chart1');
const delay = 500;
const chart = new Chart(chart1.getContext('2d'), {
type: 'line',
data: {
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
datasets: [{
label: 'My First dataset',
backgroundColor: 'rgb(255, 99, 132)',
borderColor: 'rgb(255, 99, 132)',
data: [0, 10, 5, 2, 20, 30, 45],
}],
},
options: {
plugins: {
deferred: {
delay,
},
},
},
});
// Destroy before render occurs.
setTimeout(() => chart.destroy(), delay / 2);
</script>
</body>
</html>
@BR0kEN- Thanks for the repro code.
I figured out later that it was the same issue, closing as duplicate.
Having issue when installed the deferred plugin and inserted as
chart.js version is 2.9.3 deferred plugin version is 1.0.1
any clue how to solve it?