Amchart: How the period range is selected?

576 Views Asked by At

I'm a bit confused about how the last date is selected when we specify period.

In this example when we choose 1 month the end date is 27-07-2018 but when we choose 1 year the end date 30-07-2018

(Today is 27-07-2018)

In case of 1 year I lose three days as the start of the period becomes 30-07-2017 but not 27-07-2017

I didn't find in documentation the way to specify start or end date for periods

Than you in advance

1

There are 1 best solutions below

0
xorspark On BEST ANSWER

You're likely running into how the stock charts data grouping is working with your data. By default, AmCharts groups your data into periods for performance, which can sometimes affect your period selector ranges. You can fix the period selector range output by setting extendToFullPeriod to false in the top level of your stock chart object.

AmCharts.makeChart("...", {
  // ...
  extendToFullPeriod: false,
  // ...
})