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

Show categoryAxis dates in different time zone

1 Answer 217 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 10 Feb 2014, 10:10 PM
I have a graph which is show solar irradiance vs. time (hour); users can select the location for which they want to see the graph. The category axis renders the times in local time (for me, that's CST).

How can I change the day/time displayed on the category axis to match the time zone where the data belongs (such as GMT, CET, etcetera).

Thanks.

1 Answer, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 13 Feb 2014, 09:36 AM
Hi,

Depending on the format the dates will be treated as local or UTC. For example:

  <div id="chart-utc"></div>
  <div id="chart-local"></div>
  <script>
    $("#chart-utc").kendoChart({
      categoryAxis: {
        type: "date",
        categories: [
          "2013-01-01T10:00Z", "2013-01-01T12:00Z"
        ]
      }
    });
    
    $("#chart-local").kendoChart({
      categoryAxis: {
        type: "date",
        categories: [
          "2013-01-01T10:00", "2013-01-01T12:00"
        ]
      }
    });
  </script>


Live demo

Local dates are displayed without conversion. UTC dates will be converted to the browser time zone.

If I understand correctly, your scenario calls for using local dates. Please, let us know if this is not sufficient.

Regards,
T. Tsonev
Telerik

Check out the new Telerik Platform - the only modular platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native apps. Register for the free online keynote and webinar to learn more about the Platform on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT).

Tags
Charts
Asked by
Robert
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Share this question
or