amCharts
Overview
AMCharts is a Javascript chart library that provides a variety of different charts and graphs that are pleasing to the eye and easy to use. We seek to make using their products more convenient for developers who are accessing data made available through RDS.
Formatting Tabulations
- In this example we will create a dataProvider object that can be used with amCharts. We will assume that we have a collection named test and a view named view with a variable named var that has the values 1, 2, and 3. In this example we will run a tabulation that will count the frequencies of each of these values that could be used to create a chart.
Running the tabulation would normally look something like this:
Tabulationhttp://{host}/rds/api/catalog/test/view/tabulate?dims=var
We can add the format parameter to specify we want this to be output in a way that amCharts expects to see it.
Tabulation amChartshttp://{host}/rds/api/catalog/test/view/tabulate?dims=var&format=amcharts
In addition to formatting the values in a dataProvider, we can also substitute the numeric values for the categories they represent if the variable has a classification associated with it. In this example we will assume that var has the following classification:
1 METROPOLITAN AREA 2 TOWN OR CITY 3 OPEN COUNTRY With this in mind, all we have to do is specify the metadata parameter and the output will have the categories instead of the numeric values.
Tabulation amCharts With Metadatahttp://{host}/rds/api/catalog/test/view/tabulate?dims=var&format=amcharts&metadata