Aggregate function count not working correctly with Dates

1 posts, 0 answers
  1. Ricardo
    Ricardo avatar
    1 posts
    Member since:
    Oct 2012

    Posted 29 Oct 2012 Link to this post

    I'm not sure if this is a problem, or a misunderstanding on my part, but there's an unexpected behavior with the aggregate function count on kendo charts while using dates. The issue is notable in this site's demo at :

    The problem is that if you choose the base unit as days, the count aggregate function will instead show minimum value instead of counting how many registers for that day are there.

    However, if you have at least 2 registers in any given day, the function will count correctly for that particular date.

    To further demonstrate this behavior, modify this part of the demo's code:

    function createChart() {
                            theme: $(document).data("kendoSkin") || "default",
                            title: {
                                text: "Units sold"
                            series: [{
                                type: "column",
                                data: [20, 40, 45, 30, 50, 10, 20, 30 ,40 , 50],
                                aggregate: "sum"
                            categoryAxis: {
                                baseUnit: "months",
                                categories: [
                                    new Date("2011/12/30"),
                                    new Date("2011/12/31"),
                                    new Date("2012/01/01"),
                                    new Date("2012/01/02"),
                                    new Date("2012/01/03"),
                    new Date("2011/12/31"),
                                    new Date("2011/12/31"),
                                    new Date("2012/01/01"),
                                    new Date("2012/01/02"),
                                    new Date("2012/01/03")

    There are now at least 2 registers for every day except December 30. The count is done correctly for every day except December 30, which shows the value.

Back to Top