RadHtmlChart Stacked Barchart shows labels when the value is zero

4 posts, 0 answers
  1. Ryan Johnson
    Ryan Johnson avatar
    1 posts
    Member since:
    Oct 2009

    Posted 04 Jul 2012 Link to this post

    When creating a stacked bar chart with the labels on each colored section, the label should not be displayed if the value is zero.

    I have attached an example of how Excel would create this chart and the result that I get using RadHtmlChart. Is there at least a workaround that I could do to clear out the zero labels?
  2. Marin Bratanov
    Marin Bratanov avatar
    3899 posts

    Posted 06 Jul 2012 Link to this post

    Hi Ryan,

    How is your RadHtmlChart configured? I tried setting 0 for some values in a stacked chart and things seem to be working properly with me as you can see in the attached screen capture and the page that produces it. It uses this online demo as base. Can you compare it with your setup and try to find the difference that causes the issue on your end and to apply the configuration from my example to your case?

    Kind regards,
    Marin Bratanov
    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.
  3. Goh
    Goh avatar
    3 posts
    Member since:
    Dec 2012

    Posted 02 Nov 2014 in reply to Marin Bratanov Link to this post

    I've encountered the same issue using the attached sample. (See my screenshot).
    This happens in both Firefox and Chrome.
    I am using the Telerik 2014 Q3.
  4. Danail Vasilev
    Danail Vasilev avatar
    1502 posts

    Posted 04 Nov 2014 Link to this post

    Hello Goh,

    You can use the following template for labels in order to display values that are different than zero and undefined:
    #if(value != undefined && value != 0){# #=kendo.format(\'{0:N2}\',value)# #}#

    You may also find useful the following resources:

    Danail Vasilev

    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