Item borders in radchart type pie

Thread is closed for posting
2 posts, 0 answers
  1. Roberto
    Roberto avatar
    5 posts
    Member since:
    Jun 2010

    Posted 22 Nov 2012 Link to this post

    Hi everyone,

    I had a problem with radchart type pie.

    I had two chartseriesitem and there is not problem when two items have value. The problem comes when one of two haven't value. In this case, there is a line that appears and shows something like the end of the item that has value (100%).

    A possible solution is to remove the border, but I can't remove because a requeriment is that pie have borders.

    for example, you have a pie with two sectors. Both sectors have borders. The first of sector, have 100% value and second 0%. If we remove the borders, the line dissapears, but the border of the first sector too. Is any way to preserve the border of the first sector without the line?

    Thanks in advance
  2. Petar Kirov
    Petar Kirov avatar
    425 posts

    Posted 26 Nov 2012 Link to this post

    Hello Roberto,

    You can use the ItemDataBound event of the RadChart to check if a series item is empty and if it is - you can remove it. Then you can check in the BeforeLayout event if the series has only one item and if that is the case - set the color of the border of the series to transparent: 
    //Register for the events before the DataBind() method is called
    RadChart1.ItemDataBound += RadChart1_ItemDataBound;
    RadChart1.BeforeLayout += RadChart1_BeforeLayout;
    void RadChart1_ItemDataBound(object sender, ChartItemDataBoundEventArgs e)
        if (e.SeriesItem.Empty)
    void RadChart1_BeforeLayout(object sender, EventArgs e)
        if (this.RadChart1.Series[0].Items.Count == 1)
            this.RadChart1.Series[0].Appearance.Border.Color = Color.Transparent;


    All the best,
    Petar Kirov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top