Monday, September 20, 2010

plot and embed dynamic stock chart using amcharts



1) amcharts can be downloaded from http://amcharts.com/download
I only download stock. The FAQ can be found http://amcharts.com/docs/v.1/stock
2). For beginner, only three files are most important.
amstock.swf, data.csv, amstock_settings.xml


3) I download Canada S&P/TSX csv file from
http://finance.yahoo.com/q/hp?s=^GSPTSE&a=00&b=3&c=2000&d=08&e=20&f=2010&g=d
and save it as data.csv. In amstock_settings.xml, replace date, volume close
using following, which are the data format from download.


<columns>
   <column>date</column>

   <column>open</column>
   <column>high</column>
   <column>low</column>

   <column>close</column>
   <column>volume</column>
</columns>

I change the title in amstock_settings.xml as Canada S&P/TSX
4) I simply display amstock.swf in my web server.
Below is the results, you can select any time range, the same as yahoo financial.

No comments:

Post a Comment