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

ItemLabels Appearance?

2 Answers 78 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Iurie Coroban
Top achievements
Rank 1
Iurie Coroban asked on 05 May 2009, 08:52 AM
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 Answers, 1 is accepted

Sort by
0
Accepted
Velin
Telerik team
answered on 08 May 2009, 07:10 AM
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.
0
Iurie Coroban
Top achievements
Rank 1
answered on 08 May 2009, 10:33 AM
Thanks for the answer and code example.
Tags
Chart
Asked by
Iurie Coroban
Top achievements
Rank 1
Answers by
Velin
Telerik team
Iurie Coroban
Top achievements
Rank 1
Share this question
or