1
Guys, for some reason my chartJS chart only shows the data when I press Ctrl+shift+i to open the console or when I change the page zoom, which is not very interesting for a user.
I’m testing on my laptop. Here’s the code:
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="dashboard_graph">
<div class="row x_title">
<div class="col-md-6">
<h3>Network Activities</h3>
</div>
<div class="col-md-6">
</div>
</div>
<div class="col-md-9 col-sm-9 col-xs-12">
<canvas id="myChart" width="400" height="400"></canvas>
</div>
<div class="clearfix"></div>
</div>
</div>
</div>
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: horizontal,
datasets: [{
label: '# of Votes',
data: vertical,
backgroundColor: backgroundColor,
borderColor: borderColor,
borderWidth: 1
}]
},
options: {
scales: {
yAxes: [{
ticks: {
beginAtZero:false
}
}]
}
}
});
I omitted the chartJs variables because I don’t think it comes down to how they are filled in. Does it have to do with the div that wraps the chartjs canvas?
Thank you!
Post the css of this html possibly on it has some "@media screen" causing it.
– Rafael Salomão
I don’t know anything about Chartjs, but have you ever tried to put that "beginAtZero" to "true" instead of false? Just a guess anyway.
– Seu Madruga
@inovapixel yes. Does not change anything.
– Gabriel Augusto
@Rafaelsalomão I will look and stand
– Gabriel Augusto