amCharts Documentation
Search:     Advanced search
Browse by category:

Labels in data file

Views: 998

Since v 1.4.0 of all charts you can have labels in data file (only if you are using XML data format). This is useful if you have multiple charts with the same settings and only labels are different.

Adding data labels to data XML is easy - the syntax of XML is exactly the same as it is in settings file. Here is an example:

<chart>
    <series>
        <value xid="0">Xbox 360</value>
        <value xid="1">PlayStation 3</value>
        <value xid="2">Wii</value>
    </series>
    <graphs>
        <graph gid="0" color="#9FCD95" gradient_fill_colors="#FFFFFF, #9FCD95">
            <value xid="0" description="Click for more info about Xbox 360" url="http://www.xbox360.com">399</value>
            <value xid="1" description="Click for more info about PlayStation 3" url="http://www.playstation.com">599</value>           
            <value xid="2" description="Click for more info about Wii" url="http://www.wii.com">249</value>
        </graph>
    </graphs>
   
  <labels>        
    <label>
      <x>0</x>                  
      <y>20</y>                 
      <rotate></rotate>         
      <width></width>           
      <align>center</align>       
      <text_color></text_color> 
      <text_size></text_size>   
      <text>                    
        <![CDATA[<b>Prices of Game Consoles</b>]]>
      </text>       
    </label>
  </labels>   
</chart>

Others in this Category
document Using colons and dots in data or settings urls
document Exporting charts as PDF and some image formats using third party software
document How to display language-specific characters in amCharts
document Most frequent errors made during amCharts install
document Rotated axis values and language-specific characters