Back to amCharts.com

Data grouping into longer periods

Take this stock chart example and expand the selection with the scrollbar in the bottom of the chart. The longer period is selected, the narrower candlesticks and columns become, as the number of data points in the selected period increases. But, at some points the columns and candlesticks become wide again - the data is grouped to a longer periods at these points. First, the chart displays weekly data, then monthly and then yearly. The same would happen if you have data in hours, minutes or seconds.

This is done for two main reasons:

1) in most cases, when a long period is selected, the data for a longer period is more interesting. You could even use this as a solution instead of "drill down". 2) the chart works faster when less data points are displayed.

The critical number of data points, at which data is grouped to a longer period is set in the following setting:

<max_series>150</max_series>

The default setting is 150, which means, that when there will be more then 150 data points in the selection, the chart will group data to a longer periods.

If you don't want the chart to group data, simply set 0 for this setting.

Choosing which data should be used when grouping data

The next question is: how does the chart groups the data? There are several options and every graph can act individually. For example, if you graph shows visitors of a web site, most likely you will want to show the sum of all visitors in the week or month or year. If you show stock value, it is common practice to show the value of the last day of the week/month/year. In some cases you might want to show the first value, the average, the minimum or the maximum value of a period. To control this, find the following setting in your graph's settings:

<period_value></period_value>

The default value is "close". This means, that then grouping data to a longer periods, the last available data point of a period will be used. This is common practice when displaying stock's price.

The other possible settings are:

  • open - will use the value of the first data point of a period;
  • sum - will use the sum of all data points of a period;
  • average - will use the average value of a period;
  • low - will use the minimum value of a period;
  • high - will use the maximum value of a period;
Back to top