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;


              <PlotArea>
    <Series>
     <telerik:PieSeries DataFieldY="DataFieldName" NameField="NameField">
     <LabelsAppearance ClientTemplate="#=dataItem.NameField#">
     </LabelsAppearance>
     </telerik:PieSeries>
     </Series>
    </PlotArea>
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Derek
    Derek avatar
    118 posts
    Member since:
    Oct 2008

    Posted 20 Aug 2013 Link to this post

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

    Posted 15 May 2014 Link to this post

    Hi,

    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?
  6. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 16 May 2014 Link to this post

    Hi Bill,

    This case is explained here: http://feedback.telerik.com/Project/108/Feedback/Details/38633-add-the-ability-to-handle-long-labels-and-titles-in-radhtmlchart. 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.


    Regards,

    Marin Bratanov
    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.

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