Label position for exploded pie piece

Thread is closed for posting
3 posts, 1 answers
  1. Daniel
    Daniel avatar
    184 posts
    Member since:
    Feb 2009

    Posted 05 Oct 2009 Link to this post

    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. Answer
    Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 06 Oct 2009 Link to this post

    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.
  3. Daniel
    Daniel avatar
    184 posts
    Member since:
    Feb 2009

    Posted 06 Oct 2009 Link to this post

    Thanks Manuel, that worked.

    Daniel
Back to Top