amcharts5
amcharts5 copied to clipboard
YTD is defined relative to Jan 1 rather than Dec 31
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