In this recipe, we'll use what we've learned about gauge charts and the HTML5 geolocation API to create a compass. Our compass may not be as accurate as a physical compass, but it should give us a decent approximation of our heading.
Not all browsers/devices provide the necessary data to get heading information, so this recipe may not work in all circumstances.
To set up a basic page and install jQuery and Highcharts, refer to the instructions in the Getting ready section of the Creating your first chart recipe in Chapter 1, Getting Started with Highcharts.
To get started, follow the ensuing instructions:
<div id='container'></div> ...