0π
I had the same problem updated is undefined
.
For me, the error happened because of a conflict with an old version of the library prototypejs
.
Example:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<canvas id="chartJsCanvas"></canvas>
<script src="https://ajax.googleapis.com/ajax/libs/prototype/1.6.0.3/prototype.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.bundle.js"></script>
<script type="text/javascript">
window.onload = function() {
new Chart(document.getElementById('chartJsCanvas').getContext('2d'), {
type: 'line',
data: {
datasets: [{data:[1,2]}],
}
});
};
</script>
</body>
</html>
https://jsbin.com/zedakufimi/edit?html,output
You just have to remove the dependency in the jsbin linked to see the chart being displayed.
New versions doesnβt seem to have the conflict.
- Chartjs-Chartjs align origin of the axis to the corner of graph
- Chartjs-Chartjs-plugin: How to add a different color to each label?
Source:stackexchange.com