This is a migrated thread and some comments may be shown as answers.

Aggregate function count not working correctly with Dates

0 Answers 120 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Ricardo
Top achievements
Rank 1
Ricardo asked on 29 Oct 2012, 08:29 PM
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 :

http://demos.kendoui.com/dataviz/bar-charts/date-axis.html

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() {
                    $("#chart").kendoChart({
                        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.


No answers yet. Maybe you can help?

Tags
Charts
Asked by
Ricardo
Top achievements
Rank 1
Share this question
or