Skip to content

Instantly share code, notes, and snippets.

@krizex
Created February 28, 2019 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krizex/0336e725e1e1549ddb15919abc19a342 to your computer and use it in GitHub Desktop.
Save krizex/0336e725e1e1549ddb15919abc19a342 to your computer and use it in GitHub Desktop.
charts without label
<body>
<canvas id="myChart" width="200" height="200"></canvas>
</body>
<script>
var ctx = document.getElementById("myChart");
var myChart = new Chart(ctx, {
type: 'line',
data: {
labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
datasets: [{
label: '# of Votes',
data: [12, 19, 3, 5, 2, 3],
}]
},
options: {
responsive: false,
legend: {
display: false
},
scales: {
xAxes: [{
ticks: {
display: false //this will remove only the label
}
}],
yAxes: [{
ticks: {
display: false //this will remove only the label
}
}]
}
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment