AmPie allows you to use dynamic data. This means that the data will be generated at the moment when you load the page. The data generation is done by an external script - PHP, ASP, .NET, Perl, Ruby on Rails or any other Web programming environment or Ajax data source.
You will need some knowledge of programming to create the data-generating script. Because the script would be specific to your particular task, it is impossible to provide a tutorial for creating it. This chapter contains tips on attaching the data script to the chart, and passing parameters to the script in the URL.
The HTML code for the chart contains the following line:
so.addVariable("data_file", escape("ampie/ampie_data.xml"));
You can replace ampie/ampie_data.xml with a different URL. This can be a PHP file, or any other online file. It can even contain HTTP parameters. As long as the software can call that URL, and get back the data in an expected format (XML or CSV), the chart will work.
Here is an example of a PHP file returning XML data. This file just generates random values. You will need to create your own code to display your information.
You can pass parameters to the data file. For example:
so.addVariable("data_file", escape("ampie/ampie_data.php?chart_id=1&city_id=2>"));
We have now passed two variables to our data file: chart_id and city_id. Now you need to extract them in your data file. Different programming languages use different syntax for extracting variables from the URL.
PHP: var $title= $_GET["title"]);
ASP.NET (C#): string title = Request.QueryString["title"]
Since know these variables, you can access certain tables in your database and output the required data.