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

Y axis lable with hh:mm

3 Answers 84 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, 07:04 AM

Hi 

We have to show Y Axis lable as a format of hh:mm as well as with the tooltip, currently we have the implmentation of showing it as hh.mm.

Any kendo support/format available for this.

 

 

3 Answers, 1 is accepted

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

I find it challenging to give specific advice without looking at the setup that you're currently using.
In any case, the Y axis label template should be able to provide the needed flexibility in formatting the labels.

A runnable code snippet will be greatly appreciated if using a template doesn't address the issue.

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Hitesh
Top achievements
Rank 1
answered on 29 Sep 2015, 10:36 AM

Hi 

i want something below, colon value as a data to show on Y axis.

 $("#chart").kendoChart({
        valueAxis: {
            narrowRange: false
        },
        series: [{
            data: [1:22, 2:24,3:34,4:34]
        }],
       tooltip: {
                    visible: true,
                    format: "{0:0:00}",
                   
                }
    });​

0
T. Tsonev
Telerik team
answered on 01 Oct 2015, 01:50 PM
Hi,

I see what you mean.
It's best that we use the tick representation of the Date. The 1:22 syntax is not valid JavaScript.

Something in the line of:
data: [new Date("2015/01/01 01:22").getTime(), new Date("2015/01/01 02:24"), ...]

You can then ignore the date part:
tooltip: {
  format:"#= kendo.format('{0:HH:mm}', new Date(value)) #"
}

See this snippet for an example.

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
Hitesh
Top achievements
Rank 1
Share this question
or