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

DateTime x-axis / Format as week of year

1 Answer 160 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
Veteran
James asked on 07 Jan 2019, 09:50 PM

I have a Telerik.Reporting.Graph configured as a Line graph with a DateTime x-axis. Is there a way I can format the graph label so that it displays the week of the date? For example, instead of displaying a date and time, I'd like the x-axis label to display "Week 1 - 2018", "Week 2 - 2018", etc.

The formatting seems declarative without any ability to introduce customization that transforms the graph label.

I attached a screenshot for reference.

Thanks,

Jim

1 Answer, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 10 Jan 2019, 04:15 PM
Hello Jim,

To customize the X-axis label you may use CategoryScale instead of DateTimeScale. Note that DateTime object properties like DayOfYear, etc. are Integer and *not* DateTime and are not suitable for DateTimeScale.
In the CategoryScale you may set CategoryGroups->Groupings to the desired Expression - check the attached screenshot and report definition.
For the particular requirement to use the Week of the Year it may be necessary to create a User function that returns the desired string based on the corresponding data field, as DateTime does not have a dedicated property for this value.

Regards,
Todor
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
James
Top achievements
Rank 1
Veteran
Answers by
Todor
Telerik team
Share this question
or