Showing name instead of value on pie chart segments

5 posts, 1 answers
  1. Derek
    Derek avatar
    118 posts
    Member since:
    Oct 2008

    Posted 15 Aug 2013 Link to this post

    Is it possible to show the name value instead of the data value on the pie chart segments? Basically, what we'd like to do is to show the data that is on the legend on the pie segment, instead of the number value. For example if I have a segment that shows Widgets, with a value of 30, currently the pie will show 30; I'd like to show the word 'Widget' instead.

    Is this possible?
  2. Answer
    Barbaros Saglamtimur
    Barbaros Saglamtimur avatar
    110 posts
    Member since:
    Jul 2012

    Posted 19 Aug 2013 Link to this post

    Yes, use ClientTemplate for LabelsAppearance eg;

     <telerik:PieSeries DataFieldY="DataFieldName" NameField="NameField">
     <LabelsAppearance ClientTemplate="#=dataItem.NameField#">
  3. Derek
    Derek avatar
    118 posts
    Member since:
    Oct 2008

    Posted 20 Aug 2013 Link to this post

    Thanks, this worked perfectly!
  4. Bill
    Bill avatar
    3 posts
    Member since:
    Dec 2013

    Posted 15 May 2014 Link to this post


    I'm trying to do a similar kind of thing with my label. But my template uses two dataitems with a <br /> in between. This approach seems to work for the tooltip client template but not with the labels client template. Any suggestions or workarounds?
  5. Marin Bratanov
    Marin Bratanov avatar
    3907 posts

    Posted 16 May 2014 Link to this post

    Hi Bill,

    This case is explained here: Put shortly - SVG (what RadHtmlChart uses to render the image) does not support line breaks. The tooltips are actually HTML elements, so they can work with the <br /> tag.


    Marin Bratanov

    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.

Back to Top