Answer by Alexander Abramov for How can I hide dataset labels in Chart.js v2?
for me also needed to remove x-axis and y-axis labels. for that use:options: { scales: { x: { display: false, // Hide x-axis label }, y: { display: false, // Hide y-axis label } }}
View ArticleAnswer by Prid for How can I hide dataset labels in Chart.js v2?
⬆ v3.0.0 and after...options: {plugins: { legend: { display: false }}}⬇ Before v3.0.0...options: { legend: { display: false }}
View ArticleAnswer by Ludolfyn for How can I hide dataset labels in Chart.js v2?
For those who want to remove the actual axis labels and not just the legend in 2021 (Chart.js v.3.5.1). Note: this also removes the axes.const chartWrap = document.querySelector('.chart-wrap')const...
View ArticleAnswer by Rex. A for How can I hide dataset labels in Chart.js v2?
New Solution ChartJS v3.1.1The above solution is correct for previous versions of chart js prior to v3.1 for v3.1.1 use the following ... options: { plugins:{ legend: { display: false } } }
View ArticleAnswer by Zakariya Qureshi for How can I hide dataset labels in Chart.js v2?
As of 2021, the namespace has changed from options.legend to options.plugins.legend. This simple code worked for me -options: { plugins: { legend: { display: false } }}Documentation reference
View ArticleAnswer by Sajeel Hassan for How can I hide dataset labels in Chart.js v2?
Replace options with this snippet, will fix for Vanilla JavaScript Developersoptions: { title: { text: 'Hello', display: true }, scales: { xAxes: [{ ticks: { display: false } }] }, legend: { display:...
View ArticleAnswer by jurcola for How can I hide dataset labels in Chart.js v2?
new Chart('idName', { type: 'typeChar', data: data, options: { legend: { display: false } } });
View ArticleAnswer by Reynald Ramirez de Luna for How can I hide dataset labels in...
It's just as simple as adding this:legend: { display: false,}Or if you want you could use this other option which should also work:Chart.defaults.global.legend.display = false;``
View ArticleAnswer by mpen for How can I hide dataset labels in Chart.js v2?
You can also put the tooltip onto one line by removing the "title":this.chart = new Chart(ctx, { type: this.props.horizontal ? 'horizontalBar' : 'bar', options: { legend: { display: false, }, tooltips:...
View ArticleAnswer by Rochan for How can I hide dataset labels in Chart.js v2?
add:Chart.defaults.global.legend.display = false;in the starting of your script code;
View ArticleAnswer by potatopeelings for How can I hide dataset labels in Chart.js v2?
Just set the label and tooltip options like so...options: { legend: { display: false }, tooltips: { callbacks: { label: function(tooltipItem) { return tooltipItem.yLabel; } } }}Fiddle -...
View ArticleHow can I hide dataset labels in Chart.js v2?
I have the following code to create a graph using Chart.js v2.1.3:var ctx = $('#gold_chart');var goldChart = new Chart(ctx, { type: 'line', data: { labels: dates, datasets: [{ label: 'I want to remove...
View Article