This is a migrated thread and some comments may be shown as answers.

Hide labels on date axis that have no data

1 Answer 150 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 04 Apr 2014, 10:23 PM
Hi,

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
                  .Step(2)
              )
              .Name("label-axis")
              .Categories(model => model.Date)
          ) 





1 Answer, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 08 Apr 2014, 12:26 PM
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.

Regards,
Iliana Nikolova
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.

 
Tags
Chart
Asked by
Kevin
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Share this question
or