Populate StackedBar Chart with Sparse Data

4 posts, 0 answers
  1. Eli Schleifer
    Eli Schleifer avatar
    5 posts
    Member since:
    Jul 2009

    Posted 28 Jun 2010 Link to this post

    I am looking for some guidance on how to populate a StackedBar chart with Sparse data. Take for example the 3 categories of Animals : Monkeys, Dogs, Cats. My Data set then includes counts of those animals for a given period of time

    2010 - Dogs = 7, Cats = 5, Monkeys = 0
    2009 - Dogs = 4, Cats = 0, Monkeys = 3
    2008 - Dogs = 0, Cats = 0, Monkeys = 22

    I don't want the chart to render the zeroes for the animals when they are missing. I just want to present the data for animals that are present. I am building my data now from a List of double[] which does not appear to do the trick. I tried passing in NaN for the blank postions or using double? and NULL but that did not work either.

    Please provide some guidance here.


  2. Giuseppe
    Giuseppe avatar
    2363 posts

    Posted 30 Jun 2010 Link to this post

    Hello Eli Schleifer,

    Unfortunately the current version of the control does not provide proper support for sparse data scenarios (i.e. empty values) and at the moment it is not possible to hide the "zero" labels. We will do our best to introduce public API to control the labels visibility in this scenario for the next official release that is scheduled around mid-July.

    Sorry for the temporary inconvenience.

    Kind regards,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Sam
    Sam avatar
    23 posts
    Member since:
    Oct 2011

    Posted 06 Jan 2012 Link to this post

    Has this been accomplished yet? If so, can you please provide an example in C# of how to hide a zero value in a data series? Thanks!

  4. Bartholomeo Rocca
    Bartholomeo Rocca avatar
    247 posts
    Member since:
    May 2006

    Posted 09 Jan 2012 Link to this post

    Hello Sam,

    You can achieve the desired appearance by setting the StackedBarSeriesDefinition.LabelSettings.ShowZeroValueLabels property to false.

Back to Top