condor888
asked on
How to label the time as "hh:mm:ss" on Kendo UI line chart
I've created a demo as in this fiddle.
The code is also pasted below for your convenience.
But currently the label on the x-axis is in the format of "hh:mm". However, what I need is "hh:mm:ss". Although I tried
Would you please let me know the right way of doing this?
The code is also pasted below for your convenience.
var generateTrend = function() {
$("#chart").kendoChart({
xAxis: {
labels: {
template: "#:kendo.toString(value,'dd/MM/yyyy hh:mm:ss')"
},
title: {
text: "Time"
}
},
series: [{
type: "line",
field: "value",
categoryField: "date",
"data": [{
date: new Date(2013, 0, 1, 1, 1, 0),
value: 3
},
{
date: new Date(2013, 0, 1, 1, 2, 0),
value: 4
}, {
date: new Date(2013, 0, 1, 1, 3, 0),
value: 5
},
{
date: new Date(2013, 0, 1, 1, 4, 0),
value: 7
},
]
}]
});
};
generateTrend();
But currently the label on the x-axis is in the format of "hh:mm". However, what I need is "hh:mm:ss". Although I tried
template: "#:kendo.toString(value,'dd/MM/yyyy hh:mm:ss')"
in the code, it does't seem to work.Would you please let me know the right way of doing this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER