Percentage (%) & its value is not showing in Pie Chart

Thread is closed for posting
2 posts, 0 answers
  1. Vishnu
    Vishnu avatar
    31 posts
    Member since:
    Jul 2012

    Posted 22 Apr 2014 Link to this post

    Hello Team,
    I am using Telerik Version 14.1. I have created simple RadChart in Pie type. But I am unable to show the % of area covered. Can you please suggest how to show the percentage over the chart. I tried a lot & referred so many links. still didn't get. Please help me out.


    For the ref i have attached image.


    let me know for any query.

    aspx page:
    <telerik:RadChart ID="RadChart1" runat="server" Width="540px" Height="330px" DataSourceID="SqlDataSource1" DefaultType="Pie" ChartTitle-TextBlock-Text="Summary Chart">
                <Series>
                 <telerik:ChartSeries Type="Pie" DataYColumn="Hits" DataLabelsColumn="PageName">
                    <Appearance LegendDisplayMode="ItemLabels" />
                </telerik:ChartSeries>
                </Series>
            </telerik:RadChart>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:RPConnectionString %>" 
                SelectCommand="xsp_GetPageRank" SelectCommandType="StoredProcedure"></asp:SqlDataSource><br />








  2. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1490 posts

    Posted 25 Apr 2014 Link to this post

    Hi Vishnu,

    You can use the DefaultLabelValue="#%" property. For example:

    ASPX:
    <telerik:RadChart ID="RadChart1" runat="server" Width="540px" Height="330px" DefaultType="Pie" ChartTitle-TextBlock-Text="Summary Chart">
        <Series>
            <telerik:ChartSeries Type="Pie" DataYColumn="Hits" DefaultLabelValue="#%">
                <Appearance LegendDisplayMode="ItemLabels" />
            </telerik:ChartSeries>
        </Series>
    </telerik:RadChart>
    C#:
    protected void Page_Load(object sender, EventArgs e)
    {
        RadChart1.DataSource = GetData();
        RadChart1.DataBind();
    }
     
    protected DataTable GetData()
    {
        DataTable dt = new DataTable();
     
        dt.Columns.Add("ID", typeof(int));
        dt.Columns.Add("PageName", typeof(string));
        dt.Columns.Add("Hits", typeof(double));
     
        dt.Rows.Add(1, "Q1", 7);
        dt.Rows.Add(2, "Q2", 6);
        dt.Rows.Add(3, "Q3", 3);
        dt.Rows.Add(4, "Q4", 4);
     
        return dt;
    }

    More information on the matter is available in DefaultLabelValue help article.

    Regards,
    Danail Vasilev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top