I am new to D3 and created several diagrams with varying degrees of success, but now I am stuck in a problem that does not make sense to me when using a degree to define a domain in DC.js barChart.
Using the following, you get strange results with an x axis between 0 and 2000'ish:
.x(d3.time.scale().range([0, width]).domain(d3.extent(dataset, function(d) { return d.dt; })))
while the following, with exactly the same values hardcoded in the ranges of the scale, works great.
.x(d3.time.scale().range([0, width]).domain([parseFormat("2014-03-28"),parseFormat("2015-08-07")]))
As far as I can see, there is no difference between the array that is passed to the domain function, but I get two different results. What am I missing?
var test = d3.extent(dataset, function(d) { return d.dt; });
var test2 = [parseFormat("2014-03-28"),parseFormat("2015-08-07")];
debugger;
> test
< Array (2) = $1
0Fri Mar 28 0014 00:00:00 GMT+0100 (CET)
1Fri Aug 07 2015 00:00:00 GMT+0200 (CEST)
> test2
< Array (2) = $2
0Fri Mar 28 2014 00:00:00 GMT+0100 (CET)
1Fri Aug 07 2015 00:00:00 GMT+0200 (CEST)
source
share