Enabling Charting in ActionScript and Flex applications with Google Chart API
Use Loader and REST-like request to render your charts
Google has own Chart API that anyone can access via REST web services, so generally speaking you just pass some values via URL request and as result you getting your Line Chart, Bar Chart Pie and etc...
The Google Chart API lets you dynamically generate charts on fly, you can get very detailed information on http://code.google.com/apis/chart/
So after having quick look into docs Google provided I've done a simple wrapper on top of Chart API, so its functionality became available for me from ActionScript 3 as well.
You can download sample classes from http://sas3u.googlecode.com/svn/trunk/v.1.0/classes/com/skitsanos/charts/
A bit later on I will updated it with more functionality, for now it is just more like proof of concept.
And here is the sample of how to use it:
package
{
import com.skitsanos.charts.ChartDataSet;
import com.skitsanos.charts.LineChart;
import flash.display.Sprite;
public class Main extends Sprite
{
public function Main():void
{
super();
var linechart:LineChart = new LineChart();
linechart.chartTitle.title = "My money flow";
var income:ChartDataSet = new ChartDataSet();
income.values.push(15);
income.values.push(30);
income.values.push(35);
linechart.dataSets.push(income)
linechart.draw();
addChild(linechart);
}
}