Snooks
Snooks

Reputation: 131

How to set Kendo Chart to use first day as Monday for date category axis?

I have a simple set of data points that I want to plot on a Kendo line chart. The x-axis set of data is the Monday of 4 consecutive weeks. However, when I plot that data, the x-axis shows the date for Sunday, instead of Monday.

See here for an example: http://dojo.telerik.com/ALEPe/3

I tried to set the culture in a couple of places before setting up the chart using: kendo.culture().calendar.firstDay = 1; However, that seems to have no effect.

Can anybody help me figure out how to get it to use Monday, instead of Sunday?

Thank you!

Upvotes: 1

Views: 651

Answers (1)

user5490729
user5490729

Reputation:

 $("#chart").kendoChart({
                    title: {
                        text: "Units sold"
                    },
                    dataSource: {
                        data: stats
                    },
                    series: [{
                        type: "line",
                        aggregate: "avg",
                        field: "value",
                        categoryField: "date"
                    }],
                    categoryAxis: {
                        baseUnit: "weeks",
                        weekStartDay: 1
                    }
                });

It's in the docs, you can find it here

Upvotes: 1

Related Questions