Quantcast
Viewing all articles
Browse latest Browse all 22

How 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 this Label',            data: prices,            pointRadius: 0,            borderWidth: 1        }]    }});

The code looks simple, but I cannot remove the label from the graph. I tried a lot of solutions I found online, but most of them use Chart.js v1.x.

How can I remove the dataset labels?


Viewing all articles
Browse latest Browse all 22

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>