Back to amCharts.com

Telling the graphs which data should they use

After you set up your data, you will need to tell your graphs which data should they use. The data sources of a graph are defined in the <data_sources> section of the settings file. Different graph types require a different number of data sources. Line, column, step and step_no_risers graphs require only one data source - <close>. OHLC and candlestick graphs require 4 data sources: <open>, <low>, <high> and <close>.

So for the first group of graph types, which require one data source only, the <data_sources> section will look like this:

<data_sources>
   <close>value</close>
<data_sources>

The "value" here is the name of the column that you gave during data setup.

The data source settings example for OHLC and candlestick charts:

<data_sources>
   <open>open</open>
   <low>low</low>
   <high>high</high>
   <close>close</close>
<data_sources>

As you see, the data source and the column names are the same here. This is not mandatory, and might be helpful or confusing in some cases.

Back to top