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

Dynamic LabelFormat?

2 Answers 144 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Jesper
Top achievements
Rank 1
Jesper asked on 05 Jul 2012, 02:45 PM
Hello,

I'm currently getting myself introduced to ChartView and in my project I would like for the horizontal axis (DateTimeContinuousAxis) to dynamically select a LabelFormat depending on the time being presented. For full hours I'd like it to be "mm/ddd HH", otherwise just "HH:mm".

I'd prefer to do it in MVVM if possible but I'm not too religious about it. I have tried using a converter but I don't know how to obtain the actual value being affected by the format.

Can this be achieved?

2 Answers, 1 is accepted

Sort by
0
Accepted
Petar Kirov
Telerik team
answered on 10 Jul 2012, 02:52 PM
Hello Jesper,

Your were on the right track with the converter.

You should re-template the default LabelTemplate of the DateTimeContinuousAxis and in the DataTemplate and you should set the TextBlock to use your custom converter.

Have a look at the attached project.

Greetings,

Petar Kirov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Jesper
Top achievements
Rank 1
answered on 12 Jul 2012, 11:16 AM
Thanks Petar, that did it!
Tags
ChartView
Asked by
Jesper
Top achievements
Rank 1
Answers by
Petar Kirov
Telerik team
Jesper
Top achievements
Rank 1
Share this question
or