2
Hello!
I’m using Chart.js in a project, but I need to hide the caption that is displayed above the chart.
Someone who has worked with this chart knows how to hide this part?
Follow the link to the chart I’m using:
http://www.chartjs.org/docs/#bar-Chart-Introduction
Follow the code I’m using:
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ["Muito Bom", "Bom", "Regular", "Ruim", "N/A"],
datasets: [{
label: '# of Votes',
data: [12, 19, 3, 5, 2],
backgroundColor: [
'rgba(151,187,205,0.5)',
'rgba(151,187,205,0.5)',
'rgba(151,187,205,0.5)',
'rgba(151,187,205,0.5)',
'rgba(151,187,205,0.5)',
'rgba(151,187,205,0.5)'
]
}]
},
});
I need to hide the label: label: '# of Votes'
, but if I leave it blank or remove it stays as Undefined.
You are talking about the tooltip that appears on the mouse?
– Miguel
I am referring to the caption that is written: My First Dataset, I will insert the code into the question.
– Maurício Krüger
You can put the functional example here https://jsfiddle.net/0tfvnmx1/3/ . I already imported the library. To see if I can help you
– Miguel
Your answer is here in the documentation
– Ivan Ferrer
I found the answer, inserted in the comment below, found in the documentation the option to disable the legend.
– Maurício Krüger