AxisX DefaultLabelFormat="#DATAITEM.Title"

2 posts, 0 answers
  1. Cole
    Cole avatar
    1 posts
    Member since:
    Oct 2011

    Posted 09 Nov 2011 Link to this post

    A data entity has three values; Title, GoalTotal, ShipmentsTotal
    I have a chart with two horizontal series.
    I am trying unsucessfully to show the Title field as an AxisX Label using :

    P.S.   The tool tips using the same format specification work fine...

    (XAML Code follows)
    <telerik:RadChart ItemsSource="{Binding Path=TheObservableCollection}">
            <telerik:ChartTitle Style="{StaticResource styleChartTitle}" Content="Program Goals vs. Shipments" HorizontalAlignment="Center"/>
            <telerik:ChartLegend Header="Legend" x:Name="chartLegend" />
          <telerik:ChartDefaultView.ChartArea  >
            <telerik:ChartArea LegendName="chartLegend" ItemOverlapPercent="70" SmartLabelsEnabled="True" >
                <telerik:AxisX DefaultLabelFormat="#DATAITEM.Title" >
                        <Style TargetType="TextBlock">
                          <Setter Property="TextAlignment" Value="Right" />
                          <Setter Property="Padding" Value="1" />
                          <Setter Property="Width" Value="200" />
                          <Setter Property="TextWrapping" Value="Wrap" />
      <telerik:RadChart.SeriesMappings  >
        <telerik:SeriesMapping LegendLabel="Program Goals">
            <telerik:HorizontalBarSeriesDefinition ShowItemToolTips="True" ItemToolTipFormat="#DATAITEM.Title" />
          <telerik:ItemMapping DataPointMember="YValue" FieldName="GoalTotal" />
        <telerik:SeriesMapping LegendLabel="Program Shipments">
            <telerik:HorizontalBarSeriesDefinition ShowItemToolTips="True" ItemToolTipFormat="#DATAITEM.Title" />
          <telerik:ItemMapping  DataPointMember="YValue" FieldName="ShipmentsTotal" />




  2. Evgenia
    Evgenia avatar
    1437 posts

    Posted 14 Nov 2011 Link to this post

    Hello Cole,

    Can you elaborate a bit more on what do you want to achieve? What is the purpose of the Title property - DataPoint.Label, DataPoint.LegendLabel or DataPoint.XCategory? Knowing this will help us to provide you with a more proper support based on your case.
    Also have in mind that using the #DATAITEM token can't be used with formatting AxisX labels as it can bes used to format  Series Items Labels and Tooltips only. More information about it can be found in our help topic

    All the best,
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Back to Top