-1
Good morning guys, I recently decided to implement Chart.js in some of my projects, but it does not show me the data.
I am leaving below the test source code that is not displayed.
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<canvas class="line-chart"></canvas>
<!-- CHART JS IMPORT -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.min.js"></script>
<script>
var ctx = document.getElementsByClassName("line-chart")
// Type, Data e options
var ChartGraph = new chart(ctx, {
type:'line'
data:{
labels: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun","Jul", "Ago", "Set", "Out", "Nov", "Dez"],
datasets: [{
label: "Taxa de Cliques - 2020",
data: [5,10,5,14,20,15,6,14,8,12,15,5,10],
borderWidth: 6,
borderColor: 'rgba(77,166,253,0.85)',
backgroundColor: 'transparent',
}]
}
})
</script>
</body>
</html>
Thanks brother, solved my problem!
– Eric Vinicius
good, do not forget to accept the answer ;)
– Ricardo Pontual