1
var chartData = {
labels: [<?php echo html_entity_decode($nomes) ?>],
datasets: [{
label: 'Desempenho global (Todas limpezas efetuadas em <?php echo $anoAvaliado ?>)',
data: [<?php foreach($limpezasAnuais as $limpeza){ echo $limpeza.",";} ?>],
backgroundColor: [<?php foreach ($cores as $cor){echo "\"" . $cor . "\",";} ?>],
borderWidth: 1
}]
}
var ctx = document.getElementById("myChart");
var myChart = new Chart(ctx, {
type: 'horizontalBar',
showTooltips: false,
data: {
labels: [<?php echo html_entity_decode($nomes) ?>],
datasets: [{
label: 'Desempenho global (Todas limpezas efetuadas em <?php echo $anoAvaliado ?>)',
data: [<?php foreach($limpezasAnuais as $limpeza){ echo $limpeza.",";} ?>],
backgroundColor: [<?php foreach ($cores as $cor){echo "\"" . $cor . "\",";} ?>],
borderWidth: 1
}]
},
options: {
scales: {
xAxes: [{
ticks: {
beginAtZero: false
}
}]
}
}
});
I understand Netinho, but isn’t it possible that the value is displayed without me having to click and without needing the mouseover? I need it to work like this to get in the PDF.
– Vinicius Avanzi
@Viniciusavanzi is possible yes. I changed the answer. Watch out. Att.
– Netinho Santos
Just one more thing! Can you show only the value? It is displaying the names and also the legend.I wanted to post the print here but I still don’t know how to move the forum, rsrsrsrsr
– Vinicius Avanzi
@Viniciusavanzi I changed again the answer to display only the value. If you have more questions, check the plugin documentation: http://www.chartjs.org/docs/latest/ If the answer suits you, vote for it to help others. Att.
– Netinho Santos
What did you do? Changed the plugin registration ? Thank you! How do I vote in response ?
– Vinicius Avanzi
@Viniciusavanzi I put in option the callbacks function. For you to vote as the answer accepted click on 'v' gives answer. Check the print here: https://uploaddeimagens.com.br/imagens/capturr-png-6347e280-f9dd-416e-942f-97b650b40ca1
– Netinho Santos
@Viniciusavanzi O stack tem um tour onde você poderá sanar suas dúvidas como voto útil, voto de aceite para resposta, conduta e como elaborar perguntas e resposta. Follow the link https://answall.com/tour Att.
– Netinho Santos
Thank you so much for helping @Netinho Santos. It worked!!! God bless you!
– Vinicius Avanzi