We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to display the labels inside segments?

Labels Inside Column Chart Segment

Labels can be placed inside the column segments using ChartAdornment. Chart series adornments are used to display values related to a ChartSegment. The ChartAdornmentsInfo class is used to display chart series adornments. We can customize the chart series adornments using the SegmentLabelContent, ConnectorLineStyle, SymbolTemplate, and LabelTemplate properties. The positioning of adornments in the series also depends on the AdornmentsPosition property-value. The LabelTemplate property can be used as shown in the following code example to display the labels inside the chart segment.

 

Example:

 

XAML

<Syncfusion:ColumnSeries.AdornmentsInfo>

                    <Syncfusion:ChartAdornmentInfo SegmentLabelContent="LabelContentPath" ShowLabel="True" AdornmentsPosition="TopAndBottom" >

                        <Syncfusion:ChartAdornmentInfo.LabelTemplate>

                               <DataTemplate>

                                  <!--LabelTemplate for Segments.A TextBlock inside each Segments-->

                                <TextBlock Foreground="White" FontSize="25" FontWeight="Bold" Text="{Binding Item.CompanyName}" RenderTransformOrigin="0.5,0.5">

                                    <TextBlock.RenderTransform>

                                        <RotateTransform Angle="-90"></RotateTransform>

                                    </TextBlock.RenderTransform>

                                </TextBlock>

                            </DataTemplate>

                        </Syncfusion:ChartAdornmentInfo.LabelTemplate>

                    </Syncfusion:ChartAdornmentInfo>

                </Syncfusion:ColumnSeries.AdornmentsInfo>

 

Output

 

C:\Users\mageshkumar\Pictures\Q17.png

 

 

 

Article ID: Published Date: Last Revised Date: Platform: Control: .NET Framework: Product Version:
2582 09/03/2014 03/08/2018 Windows Phone SfChart 4.5 12.1.0.43
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon