Now that we have discussed a little of the trigonometry necessary to draw our SVG chart, let me step through the JavaScript we need to add to make our code work:
<script>
document.getElementById("min_angle").onchange = function() {
var min_angle = Number(this.value);
var max_angle = Number(document.getElementById
("max_angle").value);
if( min_angle >= max_angle ) {
max_angle = min_angle + 1;
document.getElementById("max_angle").value = max_angle;
}
if( min_angle < this.min ) {
min_angle = this.min;
this.value = min_angle;
}
SetPie( min_angle / 180 * Math.PI, max_angle / 180 * Math.PI );
}
document.getElementById("max_angle").onchange = function() {
var min_angle...