CSV data comes in the format:
x;y;value;bullet_color;bullet_size;url;description
For example:
100;100;40;#00FF00;;http://www.amcharts.com;amCharts -40;30;4 100;-40;15
Each new line determines a new data point/bubble. Its attributes are separated by a special character (the semicolon ';' is used by default - you can change it in the settings).
Remember, if you are using CSV data, you must tell the software to look for that format. This is done by setting <data_type>csv</data_type> in the settings file. If you load your data from a file, you will probably need to change file name of your data file too.
Here is example of XML data for scatter chart:
chart> <graphs> <graph gid="0"> <point x="154" y="45" value="112">Point description can go here</point> <point x="187" y="85" value="155"></point> <point x="198" y="32" value="160"></point> <point x="224" y="12" value="95"></point> <point x="244" y="19" value="78"></point> <point x="268" y="88" value="53"></point> </graph> </graphs> </chart>
Graphs defines the graph. Every graph has ID: gid="1". This ID is necessary if the settings for the graph are located in the settings file, and the "gid" in the data file must match the "gid" in the settings file.
Point defines the individual data point. A point must have at least "x" and "y" attributes defined. "x" and "y" can be numbers or dates. The date format is set in settings file, <date_formats><date_input> setting. The default date format is YYYY-MM-DD hh:mm:ss.
Other available attributes of a <point> are:
| value | The size of the bubble. This acts like a third dimension of data - instead of a position along an axis, the data is represented by size. |
| bullet | If you are using a scatter chart, the data points can be represented by bullets. This attribute sets the shape of the bullet - if it is not provided, no bullet is shown. The following values are available: square, round, square_outlined, round_outlined, filename.swf. The filename.swf is the name of Adobe Flash file – you can use a custom Flash object as a bullet. The Flash file must be placed in the folder specified as "path" in the HTML code snippet. Outlined bullets use the plot area color for the outline. |
| bullet_size | The size of the bullet. This only affects predefined bullet shapes, not custom Flash bullets. |
| bullet_color | The color of the bullet. This only affects predefined bullet shapes, not custom Flash bullets. |
| bullet_alpha | The opacity of the bullet. This only affects predefined bullet shapes, not custom Flash bullets. |
| url | The URL that will be opened when the viewer clicks on the bullet. You can also set the URL as a Javascript command. Because of security restrictions set by the Adobe Flash Player, the URL will not be clickable if you view the chart from a file on your hard drive. It needs to be uploaded to a Web server and then viewed through a browser for the URL to work correctly. |
| © Antanas Marcelionis Contact and feedback: info@amcharts.com | Subscribe to amCharts news |