Link to home
Start Free TrialLog in
Avatar of condor888
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.

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();

Open in new window


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')"

Open in new window

in the code, it does't seem to work.

Would you please let me know the right way of doing this?
ASKER CERTIFIED SOLUTION
Avatar of Justin Pilditch
Justin Pilditch
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of condor888
condor888

ASKER

Sorry about the late confirmation. Thank you a lot!