Note that there are some explanatory texts on larger screens.

plurals
  1. PODimple Time Format Juggling
    text
    copied!<p>I am very confused by the way dates are handled by dimple (or maybe it is just D3). </p> <p>My problem can be divided in two questions:</p> <ol> <li><p>My dates come as a column in my csv file in the format <code>%Y-%m-%d %H:%M:%S</code>. In order to convert them to date objects, I currently use the same loop I used to have in "vanilla" d3.</p> <pre><code>data.forEach(function (d) { var format = d3.time.format("%Y-%m-%d %H:%M:%S"); d.Date = format.parse(d.Date); }); </code></pre> <p>Is there a quicker way to do this with? Maybe with the <a href="http://github.com/PMSI-AlignAlytics/dimple/wiki/dimple.axis#wiki-timeField" rel="nofollow">timeField function</a>? Or <a href="https://github.com/PMSI-AlignAlytics/dimple/wiki/dimple.axis#wiki-dateParseFormat" rel="nofollow">dateParseFormat</a>? I might be wrong but those functions looks like helpers to handle dates. </p></li> <li><p>The main reason why I want to control my time objects is to be able to reformat them. Documentation seems to indicate that the <a href="https://github.com/PMSI-AlignAlytics/dimple/wiki/dimple.axis#wiki-tickFormat" rel="nofollow">tickFormat function</a> can be used for this. Unfortunately I also failed at using it. My best guess:</p> <p><code>var x = myChart.addCategoryAxis("x", "Date");</code></p> <p><code>x.tickFormat(d3.time.format("%Y-%m")); // For example for a year-month format</code></p></li> </ol> <p>only returns </p> <p><strong>x.tickFormat is not a function</strong></p> <p>Thanks a lot,</p> <p>Xavier</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload