{"action":"created","issue":{"url":"https://api.github.com/repos/vega/vega/issues/13","labels_url":"https://api.github.com/repos/vega/vega/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/vega/vega/issues/13/comments","events_url":"https://api.github.com/repos/vega/vega/issues/13/events","html_url":"https://github.com/vega/vega/issues/13","id":12793816,"number":13,"title":"Question: How to use Axes Format","user":{"login":"MatthewCarrington","id":4057713,"avatar_url":"https://avatars.githubusercontent.com/u/4057713?v=3","gravatar_id":"","url":"https://api.github.com/users/MatthewCarrington","html_url":"https://github.com/MatthewCarrington","followers_url":"https://api.github.com/users/MatthewCarrington/followers","following_url":"https://api.github.com/users/MatthewCarrington/following{/other_user}","gists_url":"https://api.github.com/users/MatthewCarrington/gists{/gist_id}","starred_url":"https://api.github.com/users/MatthewCarrington/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MatthewCarrington/subscriptions","organizations_url":"https://api.github.com/users/MatthewCarrington/orgs","repos_url":"https://api.github.com/users/MatthewCarrington/repos","events_url":"https://api.github.com/users/MatthewCarrington/events{/privacy}","received_events_url":"https://api.github.com/users/MatthewCarrington/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2013-04-04T10:16:13Z","updated_at":"2015-07-08T22:29:23Z","closed_at":"2015-07-08T22:29:23Z","body":"I have adapted the basic Bar Chart example to use a date and time axis and it works OK but when I add the format option on the axes I don't get what I'd expect. Any chance you can tell me what I'm doing wrong ?\r\n\r\n{\r\n  \"width\": 400,\r\n  \"height\": 200,\r\n  \"padding\": {\"top\": 10, \"left\": 30, \"bottom\": 20, \"right\": 20},\r\n  \"data\": [\r\n    {\r\n      \"name\": \"table\",\r\n      \"format\": {\"type\": \"json\", \"parse\": {\"x\": \"date\"}},\r\n      \"values\": [\r\n\t  {\"x\":\"2013-04-04 09:43\", \"y\":28}, \r\n\t  {\"x\":\"2013-04-04 09:44\", \"y\":55}, \r\n\t  {\"x\":\"2013-04-04 09:45\", \"y\":43}\r\n       ]\r\n    }\r\n  ],\r\n  \"scales\": [\r\n    {\r\n      \"name\":\"x\", \r\n      \"type\":\"time\", \r\n      \"range\":\"width\", \r\n      \"domain\":{\"data\":\"table\", \"field\":\"data.x\"}\r\n    },\r\n    {\r\n      \"name\":\"y\", \r\n      \"range\":\"height\", \r\n      \"nice\":true, \r\n      \"domain\":{\"data\":\"table\", \"field\":\"data.y\"}\r\n    }\r\n  ],\r\n  \"axes\": [\r\n    {\r\n      \"type\":\"x\", \r\n      \"scale\":\"x\",\r\n      \"format\":\"%H:%M\"\r\n    },\r\n    {\r\n      \"type\":\"y\", \r\n      \"scale\":\"y\"\r\n    }\r\n  ],\r\n  \"marks\": [\r\n    {\r\n      \"type\": \"line\",\r\n      \"from\": {\"data\":\"table\"},\r\n      \"properties\": {\r\n        \"enter\": {\r\n          \"x\": {\"scale\":\"x\", \"field\":\"data.x\"},\r\n          \"y\": {\"scale\":\"y\", \"field\":\"data.y\"},\r\n          \"stroke\": { \"value\": \"red\" },\r\n          \"strokeWidth\": {\"value\": 1 }\r\n        }\r\n      }\r\n    }\r\n  ]\r\n}\r\n\r\nAlso is this the best place to ask basic usage questions or is there somewhere else ?\r\n\r\nMatthew"},"comment":{"url":"https://api.github.com/repos/vega/vega/issues/comments/119749640","html_url":"https://github.com/vega/vega/issues/13#issuecomment-119749640","issue_url":"https://api.github.com/repos/vega/vega/issues/13","id":119749640,"user":{"login":"arvind","id":42262,"avatar_url":"https://avatars.githubusercontent.com/u/42262?v=3","gravatar_id":"","url":"https://api.github.com/users/arvind","html_url":"https://github.com/arvind","followers_url":"https://api.github.com/users/arvind/followers","following_url":"https://api.github.com/users/arvind/following{/other_user}","gists_url":"https://api.github.com/users/arvind/gists{/gist_id}","starred_url":"https://api.github.com/users/arvind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arvind/subscriptions","organizations_url":"https://api.github.com/users/arvind/orgs","repos_url":"https://api.github.com/users/arvind/repos","events_url":"https://api.github.com/users/arvind/events{/privacy}","received_events_url":"https://api.github.com/users/arvind/received_events","type":"User","site_admin":false},"created_at":"2015-07-08T22:29:23Z","updated_at":"2015-07-08T22:29:23Z","body":"I think this may have been fixed sometime during v1 development. Regardless, with v2, an axis' `format` property is passed to `d3.time.format` if the associated scale is a `time` scale. "}}