 <p>The mistake was not realising JavaScript's passing-by-reference when using objects such as Date objects.</p> <p>In addition to Austin's answer, which did solve the problem by using d3 functionality, I investigated why my initial attempt by modifying the <code>minDate</code> and <code>maxDate</code> variables failed.</p> <p>The problem is that when creating the variables</p> <pre><code>var minDate = dateDim.bottom(1)[0]["timestamp"]; var maxDate = dateDim.top(1)[0]["timestamp"]; </code></pre> <p>I created pointers to the actual data instead of creating new objects with the same value as the <code>minDate</code> and <code>maxDate</code> objects. The line </p> <pre><code>minDate.setHours(minDate.getHours() - 1); </code></pre> <p>therefore then manipulated the actual underlying data within the date dimension <code>dateDim</code>, which then led to the peculiar behaviour.</p> <p>The obvious solution would have been to create <code>new Date()</code> objects like this:</p> <blockquote> <pre><code>var minDate = new Date(dateDim.bottom(1)[0]["timestamp"]); var maxDate = new Date(dateDim.top(1)[0]["timestamp"]); </code></pre> </blockquote> <p>and then do the desired manipulations:</p> <blockquote> <pre><code>minDate.setHours(minDate.getHours() - 1); maxDate.setHours(maxDate.getHours() + 1); </code></pre> </blockquote>