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

Category axis Label Display Step

1 Answer 106 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Neil
Top achievements
Rank 1
Neil asked on 26 Nov 2013, 03:45 PM
Hey,
Say I have 92 columns in a bar chart ( 3 months) , could be 90 or 91 or 93, depends on the months. Id like to display all column for each day but the labels only to appear on the 1st day of the month. Could someone please advise how to achieve this functionality.
Current category axis configuration:

categoryAxis: {
            field: "PeriodTime",
            type: "Date",
            baseUnit: "days",            
            majorGridLines: {
                visible: false
            },            
            labels: {                
                font: "6.50pt Verdana",
                color: "#666666"
            },
            color: "#aa00bb"
        },....

Thanks in Advance, any suggestions appreciated. Regards,
Neil


1 Answer, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 28 Nov 2013, 01:01 PM
Hello Neil,

In the current scenario I would recommend using a label template, which renders text only if the value is the first day of the month. For example: 
categoryAxis: [{
  baseUnit: "days",
  labels:  {
    template: "#= value.getDate() == 1 ? kendo.toString(value, 'dd-MMM') : '' #"
  },

Regards,
Alexander Popov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Charts
Asked by
Neil
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question
or