Skip to content

Commit

Permalink
Show how to use circumference and rotation options
Browse files Browse the repository at this point in the history
  • Loading branch information
pgiraud committed Mar 9, 2018
1 parent b7025fe commit 4404e88
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions samples/charts/doughnut.html
Expand Up @@ -23,6 +23,7 @@
<button id="removeDataset">Remove Dataset</button>
<button id="addData">Add Data</button>
<button id="removeData">Remove Data</button>
<button id="changeCircleSize">Semi/Full Circle</button>
<script>
var randomScalingFactor = function() {
return Math.round(Math.random() * 100);
Expand Down Expand Up @@ -138,6 +139,18 @@

window.myDoughnut.update();
});

document.getElementById('changeCircleSize').addEventListener('click', function() {
if (window.myDoughnut.options.circumference === Math.PI) {
window.myDoughnut.options.circumference = 2 * Math.PI;
window.myDoughnut.options.rotation = -Math.PI / 2;
} else {
window.myDoughnut.options.circumference = Math.PI;
window.myDoughnut.options.rotation = -Math.PI;
}

window.myDoughnut.update();
});
</script>
</body>

Expand Down

0 comments on commit 4404e88

Please sign in to comment.