How to I format Globalized Date Time label on a DateTimeContinuousAxis?

2 posts, 0 answers
  1. Mahender
    Mahender avatar
    5 posts
    Member since:
    Apr 2012

    Posted 13 Dec 2012 Link to this post

    I am using below xaml definition to draw the chart with DateTime on x-axis. Below I specified my datetime format as (H:mm \n dd-MMM). How do i make it true globalized datetime format depending on my OS locale (eg: da-DK, es-ES, ja-JP)?

    My current xaml displays: 


    Is there any way to specify datetime format where I can simply get the system locale style datetime values? Please note, I would need newline between time and date to not clutter my axis labels.

    Is there any example to localize the charts? I see if there is no data to plot the chart, default text is in english.

    Is it possible to use any format specifiers specified here in XAML?

    <telerikChart:RadCartesianChart  x:Name="radChart" Margin="0,0,19,51">
                        <telerikChart:CartesianChartGrid MajorLinesVisibility="Y" TextOptions.TextHintingMode="Animated"/>
                        <telerikChart:ChartPanAndZoomBehavior ZoomMode="Horizontal" PanMode="Horizontal"/>
                        <telerikChart:ChartTrackBallBehavior ShowTrackInfo="True" ShowIntersectionPoints="True" TrackInfoUpdated="ChartTrackBallBehavior_TrackInfoUpdated_1"/>
                    <telerikChart:RadCartesianChart.HorizontalAxis >
                                <Style TargetType="Rectangle">
                                    <Setter Property="Fill" Value="#666666"/>
                                    <Setter Property="Margin" Value="0, -3, 0, 0"/>
                        Maximum="100"  >
                    <telerikChart:AreaSeries CombineMode="Stack" Fill="{StaticResource PhoneAccentBrush}">
                                <Ellipse Width="12" Height="12" Fill="{StaticResource Series1Brush}"/>
  2. Victor
    Victor avatar
    1349 posts

    Posted 19 Dec 2012 Link to this post

    Hi Mahender,

    Thanks for writing.
    You can use the standard format specifiers in XAML, there should be no problem. Without any format specifiers, the dates and times will be displayed according to the system settings.

    In order to split the dates and times on separate lines, please use the LabelTemplate property. Inside the label template you can specify a text block and bind its Text property to the data context of the template. This binding can use a value converter in which you can split the string in two lines.

    Please read this help article in order to understand how to localize our controls including the chart.

    Please write again if you have other questions.

    All the best,
    the Telerik team
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  3. DevCraft banner
Back to Top