ItemLabels Appearance?

3 posts, 1 answers
  1. Iurie Coroban
    Iurie Coroban avatar
    32 posts
    Member since:
    Jan 2004

    Posted 05 May 2009 Link to this post

    Hi,

    In Bar Chart I have situation, when the max value= 150 and the min value=1, ItemLabel for serie where YValue==1 is not visible.
    It is possible to show ItemLabels text on the top outside the series, if yes how to do this?
    Are you planed to implement Scale Breaks?

    Thanks.
  2. Answer
    Velin
    Admin
    Velin avatar
    391 posts

    Posted 08 May 2009 Link to this post

    Hello Lurie ,

    Currently, RadChart does not expose any property for  this and the only way you could do this is to use the SeriesItemLabelStyle property of the series definition to change the template of the label controls.
    Here is a sample code:
    //the namespace of the RadChart's controls 
    xmlns:t="clr-namespace:Telerik.Windows.Controls.Charting;assembly=Telerik.Windows.Controls.Charting" 
     
    //the style which is to be applied to the series item labels. 
            <Style x:Name="labelStyle" TargetType="t:SeriesItemLabel" > 
                <Setter Property="Template"
                    <Setter.Value> 
                        <ControlTemplate TargetType="t:SeriesItemLabel" > 
                            <Canvas> 
                                <TextBlock x:Name="PART_TextContainer" 
                                            Canvas.Top="-20" 
                                            Canvas.Left="{TemplateBinding TextContainerCanvasLeft}" 
                                            VerticalAlignment="Stretch" 
                                            TextAlignment="Center" 
                                            FontSize="14" 
                                            Text="{TemplateBinding Content}" 
                                            Foreground="{TemplateBinding Foreground}"/> 
                            </Canvas> 
                        </ControlTemplate> 
                    </Setter.Value> 
                </Setter> 
            </Style> 
     
    //the series definition 
    SeriesDefinition d = new BarSeriesDefinition(); 
    d.SeriesItemLabelStyle = this.FindName("labelStyle") as Style; 

    As for your second question - currently we have no plans to implement such functionality in the near future.

    Hope this will help.

    All the best,
    Velin
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Iurie Coroban
    Iurie Coroban avatar
    32 posts
    Member since:
    Jan 2004

    Posted 08 May 2009 Link to this post

    Thanks for the answer and code example.
Back to Top