score:1
Accepted answer
In Chrome your timeScale scale is incorrect, more specifically its domain is [NaN, NaN]
. You are trying to instantiate date with dateString but that string is not in the right format - read more about Date.parse.
Compare the following code in Chrome and FF:
[new Date('2005,0,1'), new Date('2016,0,1')]
In FF that array can be parsed to date, in Chrome it contains invalid dates.
To sum up, you need to create a correct time scale, e.g. like this:
var min = d3.min(data, function(d) {
return (+d.Year) + ',0,1'
}).split(',')
var max = d3.max(data, function(d) {
return +d.Year + ',0,1'
}).split(',')
timeScale = d3.scaleTime()
.domain([new Date(min[0], min[1], min[2]), new Date(max[0], max[1], max[2])])
.range([0, width])
example: https://jsfiddle.net/devmzgwj/
Source: stackoverflow.com
Related Query
- D3 path working on Mozilla, not working on Chrome
- D3 Zoom functionality is not working in Google chrome
- d3.js not working in chrome
- SVG straight path with clip-path not visible in Chrome
- d3 file not working in chrome but works in firefox
- SVG text path not working correctly in IE
- Transition on path in d3.js is not working
- d3.js drag node boundaries not working for linked path
- svg filter not working in mozilla firefox after zoom
- "marker-mid" is not working with path d3.js force layout
- D3 sankey chart nodes click event not working in google chrome (58.0.3029.110) version
- SVG path transition in D3 (v5) not working properly
- application not working after chrome update to version 66 but works in firefox and edge
- d3 js bar chart not working in mozilla firefox
- Highlight path in d3 tree is not working in IE
- D3 Path in Group does not show up in Firefox, only shows up in Chrome
- D3.js path transition not working
- d3.js is not able to load my json on chrome but firefox & IE is working fine
- Styling not working in Mozilla Firefox
- event.pageX is working in Chrome but not working in Firefox
- Chrome not running my D3.js, but it is working fine in safari
- font size is not working in my d3.js code
- d3.select("#element") not working when code above the html element
- Title Attribute not working for an SVG Rect on Safari
- d3.js - mouseover event not working properly on svg group
- internet explorer 10 not showing svg path (d3.js graph)
- D3 - Positioning tooltip on SVG element not working
- d3.select method not working
- Month Path only calculating month, not actual date range
- D3 Bar Graph example not working locally
More Query from same tag
- Focusing on geojson in D3.js map
- bring child node close to the parent node in d3
- Programmatically zooming to prior zoom state [v7]
- How to update node data in a D3.js force graph?
- Histogram in JavaScript?
- D3 directed graph editor - v5 to v6 migration issue
- D3: combine circles and images
- How to get ng-packagr to recognize a Typescript type definition
- d3.js static graph scrolling
- D3.js rotate shape without rotating text inside
- How to increase size of pie segment on hover in d3
- D3 How to filter menu based on nested data
- Nvd3js bullet chart : Chart.update does not update the chart
- D3: Set filter flood-color based on data
- d3 / svg layering issue when adding new nodes after a time
- disable/enable dropdown list options based on filtered D3.js data
- nvd3 - how to set y axis to default values
- "d3.interpolators.push()" is not defined in D3.js v4.0, which function can replace it?
- D3 chart implementation error
- D3.js animation for donut labels
- difference between function(d) and function(d,i)?
- d3.js line chart - updating the points values
- d3.js select nodes and change their style
- How can I allign the top of two SVG's next to another?
- How to covert multiple svg to png in single html page?
- Getting D3 static tree diagrams by using force layout
- I cannot display a modified data from csv file
- Loop D3 animation of polygon vertex
- Show labels conditionally on multi series line chart
- D3.Drag Behavior with nested data