The CSV file is actually plain text. Each slice is on a new row. The parameters and value are separated by a special character. By default, this is the semicolon, but you can change it to a different character using the chart settings. The slice information is in the following order:
title;value;pull_out;color;url;description;alpha;label_radius
title - the name of the slice.
pull_out - if this is set to "true", the slice will be pulled out when the chart is first displayed.
color - the color of the slice. You must use hexadecimal
HTML color codes.
url - when the viewer clicks on the slice, the
URL specified here will open in the browser. This is disabled while you are working with files on your hard drive - it will start working when you upload the files!
description - text that will appear in the balloon when the viewer drags the mouse over the slice. You can use some
HTML tags here. Make sure you don't use the CSV separator character in the description!
alpha - opacity of the slice, in percent. If set to 0, the slice is invisible and unclickable. You can use this parameter to create partial pies. Tip: you can use partial pies with
URL-enabled slices to create unusual Flash menus for your website!
label_radius - you can set data label's distance from a pie for each slice individualy.
If you are only using the first two or more, you don't have to specify the rest. If you are skipping some parameters, but using a later one, you must use a semicolon for each skipped parameter.
Example:
China;1314.4;;;http://www.interactivemaps.org
India;1120.4
United States;300.38
Indonesia;233.52
Brazil;187.67
Pakistan;158.85
Bangladesh;148.9
Other Countries;3007.5;true;;http://www.amcharts.com;Click to find out more
Each new line determines a new slice. Its attributes are separated by a special character (the semicolon ';' is used by default - you can change it in the settings).
The sequential order of the slices in the file is the same as their order on the chart, clockwise from the top.
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 pie chart:
<pie>
<slice title="Twice a day" pull_out="true">358</slice>
<slice title="Once a day">258</slice>
<slice title="Once a week">154</slice>
<slice title="Never" url="http://www.interactivemaps.org" description="Click on the slice to find more information" alpha="50">114</slice>
</pie>
You can have any number of slices in your pie, simply add or delete <slice …></slice> rows.
<slice> can have the following attributes:
title - the name of the slice.
pull_out - if this is set to "true", the slice will be pulled out when the chart is first displayed.
color - the color of the slice. You must use hexadecimal
HTML color codes. If you do not provide the color for a slice, a set of default colors will be used.
url - when the viewer clicks on the slice, the
URL specified here will open in the browser. This is disabled while you are working with files on your hard drive - it will start working when you upload the files to your web server!
description - text that will appear in the balloon when the viewer drags the mouse over the slice. You can use some
HTML tags here, but you will have to replace < with < and > with >.
alpha - opacity of the slice, in percent. If set to 0, the slice is invisible and unclickable. You can use this parameter to create partial pies. Tip: you can use partial pies with
URL-enabled slices to create unusual Flash menus for your website!
label_radius - you can set data label's distance from a pie for each slice individualy.
pattern - If this is set, the slices will be covered with a pattern. The pattern can be provided by a SWF,
JPG,
GIF or
PNG file, and the value must be the path to that file. See the included patterns example for more.
pattern_color - The color of the pattern. The value is a hex color code.
Back to top