Even though much of the data we work with in charts comes via a backend source, there are times when we may need to get our data from an external source, such as a CSV file or an XML file.
To set up a basic page and install jQuery and Highcharts, refer to the Getting ready section of the Creating your first chart recipe in Chapter 1, Getting Started with Highcharts. Refer to the steps as described in the Using AJAX for polling charts recipe discussed earlier in this chapter.
To get started, perform the following steps:
Create a new event handler for the chart load event as shown in the following code:
var options = { chart: { events: { load: function() { // maintain a reference to the chart var self = this; // code goes here } } } };
Within our event handler, call
$.ajax
with asuccess
function to handle the retrieved data. We will also need to providedataType
, which is dependent...