O'Reilly logo

ActionScript Graphing Cookbook by Peter Backx, Dominic Gélineau

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Consuming the REST services

Many websites expose their data through web services. These services usually fall into two categories, SOAP or REST. Many data APIs now tend to prefer the more lightweight REST, which is what we will use in this recipe.

A REST service will usually provide its data in the XML or JSON format. JSON is actually a way of representing data in a piece of JavaScript code. This makes it easy for JavaScript applications to use the data.

For instance, the data we've previously used could look like the following code snippet:

{ "data" : { "0": [20, 50], "50": [70, 40], "100": [0, 100], "150": [150, 150], "200": [300, 200], "250": [200, 170], "300": [170, 160], "350": [20, 120], "400": [60, 80], "450": [250, 150], "500": [90, 20], ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required