0👍
Try to passing your data from tag body to tag script
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<script src="https://cdn.jsdelivr.net/npm/chart.js@2.8.0"></script>
<title>Documment</title>
</head>
<body>
<div class="container">
<canvas>
</canvas>
<p id="data" style="display:none"><%= value %></p>
</div>
</body>
<script>
// your data change to string
let data = document.getElementById("data").innerText
let array = data.split(',')
</script>
</html>
- Chartjs-ChartJS – Issues with positioning and viewing various components of horizontal bar
- Chartjs-Combine two line charts into one in ChartJS
Source:stackexchange.com