Quantcast
Channel: Chart.js v2 hide dataset labels - Stack Overflow
Browsing all 10 articles
Browse latest View live

Answer by Juan Ignacio Urcola for Chart.js v2 hide dataset labels

new Chart('idName', { type: 'typeChar', data: data, options: { legend: { display: false } } });

View Article



Answer by Reynald Ramirez de Luna for Chart.js v2 hide dataset labels

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 Article

Image may be NSFW.
Clik here to view.

Answer by mpen for Chart.js v2 hide dataset labels

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, },...

View Article

Answer by Rochan for Chart.js v2 hide dataset labels

add: Chart.defaults.global.legend.display = false; in the starting of your script code;

View Article

Answer by potatopeelings for Chart.js v2 hide dataset labels

Just set the label and tooltip options like so ... options: { legend: { display: false }, tooltips: { callbacks: { label: function(tooltipItem) { return tooltipItem.yLabel; } } } } Fiddle -...

View Article


Chart.js v2 hide dataset labels

I have the following codes 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...

View Article

Answer by Sajeel Hassan for Chart.js v2 hide dataset labels

Replace options with this snippet, will fix for Vanilla JavaScript Developersoptions: { title: { text: 'Hello', display: true }, scales: { xAxes: [{ ticks: { display: false } }] }, legend: { display:...

View Article

Answer by Muhammad Zakariya for Chart.js v2 hide dataset labels

As of 2021, the namespace has changed from options.legend to options.plugins.legend. This simple code worked for me -data{...},options: { plugins: { legend: { display: false } }}

View Article


Answer by Rex. A for Chart.js v2 hide dataset labels

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 Article


Answer by Ludolfyn for Chart.js v2 hide dataset labels

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 Article
Browsing all 10 articles
Browse latest View live




Latest Images