Attributes in XML Data
The data file in XML format can include settings which control the look of points on the X-axis or the graph. These are represented as tag attributes.
These settings cannot be provided through a CSV data file!
X-Axis Settings
These settings are used as attributes of the value tag inside a series section. The primary purpose of these settings is to create an event - mark out a section of the chart. You can give the event a different background, show a description of it, etc.
Here is some example XML, setting an event for the Iran-Iraq war in a chart that shows historic crude oil prices:
<series>
<value xid="1" show="true" event_start="war" event_text_color="#DADADA" event_description="The Iran-Iraq War" event_color="#000000" event_alpha="15">1980</value>
<value xid="2" event_end="war">1981</value>
</series>
The following attributes are available:
| Attribute |
Description |
| xid |
The unique identifier of the X-axis point. |
| show |
If this is set to true, the X-axis values and grid lines of this series will always be visible. By default, this is set to false. |
| event_start |
The event will start from this point. The attribute value is a unique identifier of the event. |
| event_end |
The event will end at this point. The attribute value is a unique identifier of the event. |
| event_text_color |
The color of the text in the event description. |
| event_description |
When the viewer clicks on the event background, a balloon will appear, displaying this text. |
| event_color |
The color of the event background (hex color code). |
| event_alpha |
The opacity of the event background (number between 0 and 100, where 0 is completely transparent and 100 is completely solid). |
Y-Axis Settings
These settings are used as attributes of the value tag inside a graph section. The primary purpose of these settings is to control the bullet. Bullets show the graph points. Since these attributes are set for a specific value tag, they allow you to control individual bullets.
Here is some example XML:
<graph gid="1">
<value xid="1" url="http://www.amcharts.com" bullet="round" bullet_color="#009900" bullet_size="12" description="Iranian revolution">21.59</value>
</graph>
The following attributes are available:
| Attribute |
Description |
| xid |
The unique identifier of an X-axis point. The bullet will appear above this point. |
| url |
The URL that will be opened when the viewer clicks on the bullet. You can also set the URL as a Javascript command. The URL is only used if the bullet attribute is set!
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.
|
| bullet |
The shape of the bullet. The following values are available:
- square
- round
- square_outlined
- round_outlined
- filename.swf
The latter 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_color |
The color of the bullet. This only affects predefined bullet shapes, not custom Flash bullets. |
| bullet_size |
The size of the bullet. This only affects predefined bullet shapes, not custom Flash bullets. |
| description |
The text that will be displayed in a balloon when the viewer rolls over the bullet with the mouse cursor. |