Developer forum

Forum » Development » Commerce dashboard daily comparison fails when current and previous month have different number of days

Commerce dashboard daily comparison fails when current and previous month have different number of days

Anders Ebdrup
Reply

Hi DynamicWeb,
 

Commerce dashboard widgets such as “Completed orders per day” build chart labels from the current month, but build the comparison data from the previous month without normalizing the number of days or filling missing dates with zeroes. This causes misaligned or incorrect chart data when comparing months with different day counts, e.g. June vs May or March vs February.

Additionally, the SQL date range uses <= against a date value representing the last day at midnight, which may exclude orders placed later on the last day of the month.

Expected:
Both “this month” and “last month” series should align with the same day labels, so a solution could be to always display 31 days in the chart.

Actual:
The chart can produce mismatched data lengths and/or omit data from the last day of the month.

Relevant files:
Dynamicweb.Ecommerce.UI/Dashboard/Widgets/CompletedOrdersPerDayChartWidget.cs
Dynamicweb.Ecommerce.UI/Dashboard/Widgets/OrderDataChartWidgetBase.cs

Best regards, Anders


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Yes, that does not look too good.

Bug created on https://doc.dynamicweb.dev/documentation/fundamentals/dw10release/releasenotes/workiteminfo.html?workitemid=28729

 

You must be logged in to post in the forum