Hide labels on date axis that have no data

2 posts, 0 answers
  1. Kevin
    Kevin avatar
    9 posts
    Member since:
    Aug 2013

    Posted 04 Apr 2014 Link to this post


    I am populating a Stacked Column Chart with a date axis. However, I only want to display monday-friday so I only populate the chart with dates from my data set that are weekdays.

    The chart is automatically adding blank spaces for the missing dates (weekends). When I changed it to a category axis it stopped stacking my bars and completely distorted the graph... as it created a new column for every single data point. Is there a way to hide the dates without data? Do I need to change my implementation in order to change the axis from date to category or a stacked bar chart?

    relevant code:
    public class DataViewModel
            public string Category { get; set; }
            public double? Phone { get; set; }
            public double? ClaimsWork { get; set; }
            public double? Unstaffed { get; set; }
            public double? Outbound { get; set; }
            public double? Meetings { get; set; }
            public double? Personal { get; set; }
            public DateTime Date { get; set; }

              .Series(series =>
                      series.Column(model => model.Phone).Name("Phone").Stack(ChartStackType.Stack100).Color("#009bd7");
                      series.Column(model => model.ClaimsWork).Name("ClaimsWork").Stack(ChartStackType.Stack100).Color("#76b800");
                      series.Column(model => model.Unstaffed).Name("Unstaffed").Stack(ChartStackType.Stack100).Color("#d43851");
                      series.Column(model => model.Outbound).Name("Outbound").Stack(ChartStackType.Stack100).Color("#ffd600");
                      series.Column(model => model.Meetings).Name("Meetings").Stack(ChartStackType.Stack100).Color("#AF81C9");
                      series.Column(model => model.Personal).Name("Personal").Stack(ChartStackType.Stack100).Color("#ef4c00");

              .CategoryAxis(axis => axis
                  .Labels(label => label
                  .Categories(model => model.Date)

  2. Iliana Nikolova
    Iliana Nikolova avatar
    2622 posts

    Posted 08 Apr 2014 Link to this post

    Hi Kevin,

    The described scenario is not supported by Kendo UI Chart and there is no a suitable workaround which I can suggest. Please accept my apologies for any inconvenience this may cause.

    Iliana Nikolova

    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