0

Does anyone have an example of a TechanJS H1, hourly chart (http://techanjs.org/) that uses the ISO 8061 date standard?

Thanks

ttrasn
  • 4,322
  • 4
  • 26
  • 43
Garth
  • 533
  • 1
  • 4
  • 15

2 Answers2

0

Figured it out: Use the following techan formats:

// JavaScript
var parseDate = d3.time.format("%Y-%m-%dT%H:%M:%S").parse,
      timeFormat = d3.time.format('%Y-%m-%dT%H:%M:%S'),
      valueFormat = d3.format(',.5fs');      

Use the following date format (note exactly ISO but it's what C# Json WebAPI's outputting which is what I'm after):

// C#
DateTime.ToString("yyyy-MM-ddTHH:mm:ss")
// 2015-08-24T17:00:00
Garth
  • 533
  • 1
  • 4
  • 15
0

If you have a look into test/spec/bundle/_util/date.js (v.0.6.0-6) there should be a function called parseIso8601.

I wrote it myself :)

thomas.han
  • 2,891
  • 2
  • 17
  • 14