
Phani Kumar
Top achievements
Rank 1
Phani Kumar
asked on 10 Jul 2013, 07:13 PM
Hi,
A RadChart is used in one of the projects, the Labels in the chart are always shown in different positions. Though the values for various (2)categories are same the positions of the labels are different.(Attached picture Sample3)
Is there a way to control the position of the Label. Please let me know for any workarounds.
Thank you,
Phani.
A RadChart is used in one of the projects, the Labels in the chart are always shown in different positions. Though the values for various (2)categories are same the positions of the labels are different.(Attached picture Sample3)
Is there a way to control the position of the Label. Please let me know for any workarounds.
Thank you,
Phani.
6 Answers, 1 is accepted
0
Hi Phani,
What you are observing is most probably caused by the SmartLabels feature. When two or more labels are very close to each other or are overlapping RadChart tries to rearrange them so they will not overlap. You can turn this feature off like this:
Petar Kirov
Telerik
What you are observing is most probably caused by the SmartLabels feature. When two or more labels are very close to each other or are overlapping RadChart tries to rearrange them so they will not overlap. You can turn this feature off like this:
radChart1.DefaultView.ChartArea.SmartLabelsEnabled =
false
;
I hope this helps.
Petar Kirov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0

Phani Kumar
Top achievements
Rank 1
answered on 15 Jul 2013, 03:13 PM
Hi Petar,
Thank you for your response.
Followed the below suggestion and testing the changes, in one scenario a chart label is not appearing. Please find the screen print of the scenario attached.
Please let me know if there any way to handle this.
Best Regards,
Phani.
Thank you for your response.
Followed the below suggestion and testing the changes, in one scenario a chart label is not appearing. Please find the screen print of the scenario attached.
Please let me know if there any way to handle this.
Best Regards,
Phani.
0
Hi Phani,
Another thing that you can try besides turning off the SmartLabels feature, is to set LabelDisplayMode of the series to inside, like this:
Regards,
Petar Kirov
Telerik
Another thing that you can try besides turning off the SmartLabels feature, is to set LabelDisplayMode of the series to inside, like this:
<
telerik:BarSeriesDefinition
>
<
telerik:BarSeriesDefinition.LabelSettings
>
<
telerik:BarLabelSettings
LabelDisplayMode
=
"Inside"
/>
</
telerik:BarSeriesDefinition.LabelSettings
>
</
telerik:BarSeriesDefinition
>
Regards,
Petar Kirov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0

Phani Kumar
Top achievements
Rank 1
answered on 19 Jul 2013, 01:23 PM
Hi Petar,
Thank you for the below suggestion. Tried the below LabelDisplayMode="Inside" option and the label still disappears when the value is low or zero. Please find the sample printout attached.
Please let me know for any other settings that could be used to handle this scenario.
Thank you,
Phani.
Thank you for the below suggestion. Tried the below LabelDisplayMode="Inside" option and the label still disappears when the value is low or zero. Please find the sample printout attached.
Please let me know for any other settings that could be used to handle this scenario.
Thank you,
Phani.
0
Hi Phani,
After reviewing our conversation again, I came to the conclusion that actually the SmartLabels feature should work best for you. Most likely you have set somewhere in your code a Margin to the SeriesItemLabels and that is why the labels in Sample3.png re-arranged earlier, than it is needed.
If you want to have more control when using the SmartLabels feature, you can change the label template.
In the following example you can adjust the threshold before adjacent labels are rearranged by adjusting the value of the highlighted properties:
(You can apply this style by setting it to the SeriesItemLabelStyle property of the SeriesDefinition.)
I hope this helps.
Regards,
Petar Kirov
Telerik
After reviewing our conversation again, I came to the conclusion that actually the SmartLabels feature should work best for you. Most likely you have set somewhere in your code a Margin to the SeriesItemLabels and that is why the labels in Sample3.png re-arranged earlier, than it is needed.
If you want to have more control when using the SmartLabels feature, you can change the label template.
In the following example you can adjust the threshold before adjacent labels are rearranged by adjusting the value of the highlighted properties:
<
Style
x:Key
=
"SeriesItemLabelStyle"
TargetType
=
"telerik:SeriesItemLabel"
>
<
Setter
Property
=
"Template"
>
<
Setter.Value
>
<
ControlTemplate
TargetType
=
"telerik:SeriesItemLabel"
>
<
Canvas
x:Name
=
"PART_MainContainer"
Width
=
"0"
Height
=
"0"
>
<
Path
x:Name
=
"PART_ConnectorPath"
Visibility="{Binding ConnectorVisibility,
RelativeSource={RelativeSource TemplatedParent},
Mode
=
TwoWay
}"
Style
=
"{TemplateBinding ConnectorStyle}"
Stroke
=
"{TemplateBinding Stroke}"
StrokeThickness
=
"{TemplateBinding StrokeThickness}"
>
<
Path.Data
>
<
PathGeometry
>
<
PathGeometry.Figures
>
<
PathFigure
x:Name
=
"PART_Connector"
>
<
PathFigure.Segments
>
<
PolyLineSegment
/>
</
PathFigure.Segments
>
</
PathFigure
>
</
PathGeometry.Figures
>
</
PathGeometry
>
</
Path.Data
>
</
Path
>
<
Border
x:Name
=
"PART_TextContainer"
Width
=
"15"
Height
=
"7"
/>
<
TextBlock
Width
=
"200"
Height
=
"16"
Margin
=
"-100 -8 0 0"
TextAlignment
=
"Center"
Text
=
"{TemplateBinding Content}"
/>
</
Canvas
>
</
ControlTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>
I hope this helps.
Regards,
Petar Kirov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0

Phani Kumar
Top achievements
Rank 1
answered on 23 Jul 2013, 08:14 PM
Hi Petar,
Applied the below provided style with the Smart Labels feature enabled and seem to have resolved the issue.
Thank you & Regards,
Phani.