Hi,
We recently upgraded from 2016 library to latest one. One of the widgets we are using is Chart and we have situation where we display yearly data spread through the weeks.
In previous version we simply had categoryAxis configuration set to
baseUnit: "weeks",
labels: {
step: 1,
dateFormats: {
weeks: "cw"
}
},
majorGridLines: {
visible: true
},
axisCrossingValues: [0, 54]
However, after upgrading to the new version, instead of displaying week numbers (1 to 52) it simply displays cw text.
I tried all possible things i could think of, but couldn't make it display week numbers, so I would appreciate a little help. :)
Thanks
5 Answers, 1 is accepted
Could you clarify in which version this used to work? 'cw' is not from the supported date formats. A possible approach to show the number is to use the weekInYear method in a template - example.
Regards,
Daniel
Progress Telerik

Hi Daniel, thanks for your answer.
Your suggestion works, thank you very much.
To answer your question, version that was used before is "2016.2.504".
I replaced dateFormats from my example with template as in your suggestion and it works.
Only difference I can spot is different count of the weeks (new one with yours makes more sense to me), but everything else behaves properly.
Thanks again and if can help clarify anything else please let me know.
I am glad that the suggestion helped. I also tried to replicate the previous behavior with 2016.2.504 but the 'cw' format still does not seem to work - updated example. Is it possible that the code was patched on your side to support this format?
Regards,
Daniel
Progress Telerik

Hello, I will have to dig deeper in codebase to see if someone who worked long before me did something on previous versions of library. I didn't look in Kendo lib files as it didn't make much sense to touch things there by anyone. I would personally go with override on prototype in separate file, but.. :)
I will post my findings, but it may take a some time since I have to finish migration first. :)
Thanks a lot and regards,
Vedad

Hi Daniel,
Sorry for slow answer, but it took me a while to catch what was a problem. Looks like someone extended library long ago so with abbreviation "CW" it basically returns date.getWeek (I presume this is predecessor of weekInYear).
Thanks for your help.
Best regards,
Vedad