Actually in your code, I see you are using new Date() which changes when the function is executing. so your scale for axis and scale for drawing elements gets changed. Can you try replaceing below line
updateDomains(new Date() - duration);
var currentDate = new Date(); updateDomains(currentDate - duration);
Also in tick function send currentDate to displayDomains function. when you want to change the scale you change variable currentDate.
Hope it helps.
- Time series line chart is not sync with axis
- D3 Multi Series Line chart with non time x axis
- Line chart not aligned with x axis
- C3 - line chart time series error: x is not defined for id = "Dates"
- D3 Multi Line Chart Not Displaying Properly With X Axis Value
- D3 Multi Series Line chart not working with correct xAxis values
- D3 Line Chart not having proper X & Y axis plotting with Labels
- line graph renders wrongly and problem with the X axis (time), cannot brush the graph - time series dc.js
- X axis not displaying on Multi Series Line Chart using d3.js
- d3.js line chart with time on both axis
- nvd3.js-Line Chart with View Finder: rotate axis labels and show line values when mouse over
- Dimple.js line chart with composite axis, no links between points on series
- Specifying Ticks on D3 Bar chart with Time Series data and scaleBand
- How to line up x axis on stacked bar chart with a line overlay in d3.js
- d3 bar chart with fixed bar width and fixed spacing to align in center axis line
- Multiple line chart not working with date format
- Stacked Bar Chart with Time Series Data
- How to create a multi-series line chart with series for each unique item in 1st column?
- D3 chart Y axis line is not visible in some resolutions
- Why does my bar chart using scaleBand not line up with my tick marks?
- Chart bars not aligning with x axis values in d3.js
- Why animated d3 svg line is not synchronized with the axis shift in IE9 but synchronized in IE11 and Chrome?
- d3.js - extent width not match axis line with svg defs
- Time in x-axis and data for the y-axis for line chart in d3.js doesn't match/show with what (data) is on JSON
- d3.js How to draw line chart with vertical x axis labels
- D3 line chart legend not working with v3 but working with v2
- d3js: data/column required for time series chart with dropdown list
- Show values on Y Axis as it is with Higher and lower limits NVD3 Line Chart
- D3.js Line chart with relative min and max in Y axis
- Django nvd3 Line Chart tool tip not working in case of intersection two series
More Query from same tag
- d3.js Get Legend Outside of Chart
- D3 position x axis label within rectangle and rotate 90 degrees
- d3 csv data loading
- Is there a way to set a default color for the un-selected boxes in heatmap in dc.js when crossfilter is applied?
- Line chart in D3.js - parsing the date from JSON
- If x-axis labels are string values then they are not showing up in d3 chart
- Text alignment with unknown length
- How to integrate d3.js chart in C# application?
- How to select JSON arrays with D3.js with . operator
- Rotating teardrop shape in SVG around axis point
- What is the correct way to import and use d3 and its submodules in ES6?
- Create links from node border to node border, not center to center
- Can't get d3 donut chart labels to line up correctly
- D3 - get x position on mouseover
- How to handle data using D3?
- d3 overlay object mousedown event handling
- d3.format 1 decimal plus letter X
- Individual zoom on two separate D3 tree in one browser window but different svg
- bubble chart width and height set dynamically from json data in d3.js
- nvd3.js tooltip position with multiple charts
- how to left align ticks in d3 bar chart
- "d" parameter returns undefined in a .on event
- Is it possible to set a border or linear gradient to an SVG element - line
- Problems using json recursive in treemap using D3PLUS
- How do I change the legend position in a NVD3 chart?
- D3 and TopoJSON will not load in browser
- Can I give the text and line elements that make up a D3 axis unique classes?
- How to add string text and a variable in d3.js text attribute?