amcharts5 icon indicating copy to clipboard operation
amcharts5 copied to clipboard

YTD is defined relative to Jan 1 rather than Dec 31

Open theoturner opened this issue 1 year ago • 3 comments

YTD is defined relative to the Dec 31 of the previous year.

When using a PeriodSelector as follows:

am5stock.PeriodSelector.new(root, {
  stockChart: chart,
  periods: [
    { timeUnit: "ytd", name: "YTD" },
  ],
});

The first date used is the current year's 1 Jan. This should be Dec 31 of the previous year.

A similar issue was raised and fixed in v4 but appears to have reappared in v5.

https://github.com/amcharts/amcharts4/issues/3249

theoturner avatar Feb 28 '24 09:02 theoturner