Arcs 4 - JS functions


You can draw various arcs 'by hand' using SVG commands. On previous pages you saw how this was done.

But many times it is much easier and faster to use JavaScript to do it for you.

On the next few pages we will show how to do this, and also show how they can be used to produce 'pie' charts or 'donut' charts.

You've probably seen pie charts - those colorful illustrations with pie slices representing some numerical data. Donut charts are similar, but with a whole in the middle. DUH

This brings up an interesting situation. Using SVG commands and JavaScript, we will show how to produce pie charts, then make it into a donut chart.

The data is derived from a database with Perl, but you could hard-code the data into your code for simple illustrations.

On the next page we show how to produce arcs using JavaScript funtions.