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

Label position for exploded pie piece

2 Answers 161 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Iron
Daniel asked on 05 Oct 2009, 05:30 AM
Hi. I've got a databound pie chart. In the code behind I explode a specific piece of the pie. This works okay but the label next to it doesn't move with the piece, so the label is half way into the pie piece. I tried setting the LabelLocation to Outside or Auto and this doesn't seem to fix the problem. Thanks.

    <telerik:RadChart ID="rcOcbgPart3" Skin="Simple" DefaultType="Pie" AutoLayout="True" 
        Width="680px" Height="350px" runat="server" DataSourceID="sdsOrs">  
        <Series> 
            <telerik:ChartSeries Name="reqcount" DataYColumn="requests" Type="Pie" DataLabelsColumn="call_type" 
                Appearance-LegendDisplayMode="ItemLabels" Appearance-LabelAppearance-Visible="false">  
            </telerik:ChartSeries> 
        </Series> 
        <PlotArea Appearance-FillStyle-FillType="Solid" Appearance-FillStyle-MainColor="Transparent" 
            Appearance-Border-Visible="false">  
        </PlotArea> 
        <ChartTitle> 
            <Appearance Position-AlignedPosition="Top">  
            </Appearance> 
            <TextBlock Text="Outstanding Requests Summary">  
            </TextBlock> 
        </ChartTitle> 
        <Legend Visible="True">  
            <Appearance Visible="True">  
            </Appearance> 
        </Legend> 
    </telerik:RadChart> 
 

2 Answers, 1 is accepted

Sort by
0
Accepted
Giuseppe
Telerik team
answered on 06 Oct 2009, 01:31 PM
Hi Daniel,

Generally, you can customize the label location manually by setting the SeriesItem.Label.Appearance.Distance property like this:

ASPX:
<telerik:RadChart ID="RadChart1" Skin="Simple" DefaultType="Pie" AutoLayout="True" 
    Width="680px" Height="350px" runat="server" OnItemDataBound="RadChart1_ItemDataBound"
</telerik:RadChart> 

C#:
protected void Page_Load(object sender, EventArgs e) 
    RadChart1.DataSource = new double[] { 1, 2, 3, 4, 5, 6 }; 
    RadChart1.DataBind(); 
 
    RadChart1.Series[0].Appearance.ExplodePercent = 50; 
 
protected void RadChart1_ItemDataBound(object sender, ChartItemDataBoundEventArgs e) 
    if (e.SeriesItem.Index == 4) 
    { 
        e.SeriesItem.Appearance.Exploded = true
        e.SeriesItem.Label.Appearance.Distance += 10; 
    } 


Hope this helps.


Sincerely yours,
Manuel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Daniel
Top achievements
Rank 1
Iron
answered on 07 Oct 2009, 01:31 AM
Thanks Manuel, that worked.

Daniel
Tags
Chart (Obsolete)
Asked by
Daniel
Top achievements
Rank 1
Iron
Answers by
Giuseppe
Telerik team
Daniel
Top achievements
Rank 1
Iron
Share this question
or