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

Partial Month, Week Label with asterisk '*'

1 Answer 44 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Hitesh
Top achievements
Rank 1
Hitesh asked on 17 Sep 2015, 06:48 AM

Hi 

we show chart/graph with data as month, week, day wise aggregation, user can select date range criteria for which he/she needs to have the data.

On X Axis we show lables in format of "month/year", "start week/end week" for the data. I need to show label with asterisk '*' when the data is selected for partial month on X Axis.

Example : user selects date range from 10/10/2014 to 10/12/2014  - (10oct to 10 dec)

Here for us October and December are partial month as it will have only 10 days of data in chart/graph, while november is not considered as partial month.

Any kendo support available for this.

 

Regards,

Hitesh 

 

1 Answer, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 21 Sep 2015, 10:30 AM
Hello,

I'm afraid I can't offer anything better than customizing the axis label template.
In its context you have access to the actual date ("value") and can format the label based on this and on the set range. 
categoryAxis: {
  labels: {
    template: "#= labelTemplate(data) #"
  }
}
...

function labelTemplate(e) {
    if (...) {
      return "*"
    }

    // Otherwise use default format
    return kendo.toString(e.value, e.format);
}

I hope this helps.

Regards,
T. Tsonev
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
Hitesh
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Share this question
or