Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions samples/charts/doughnut.html
Original file line number Diff line number Diff line change
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