score:1
You don't mention where your coordinates are coming from, but I suspect they are based on GIS (x, y, z) format, so the order is [longitude, latitude]
. This will cause your image to be "rotated" -- if you reverse the x/y values, that should help. There is a good discussion about the evolution of these different coordinate systems (navigation vs. graphing) on this SO thread.
Also, the path you are generating appears to be "flipped" vertically. I can't tell you how many times I've done that, because the page's coordinate system is not what most of us expect. The upper-left corner is (0, 0), and the y-values increase down the page. The most intuitive way (for me) is to invert the y-axis's output range -- one way is like this:
var yScale = d3.scale.linear()
.domain([minY, maxY])
.range([height, 0]);
That way, the minimum y-coordinates (i.e. latitude, in your case) are mapped to the bottom of the SVG area (the "height" variable), while the maximum values are mapped to 0 (the top of the screen).
Source: stackoverflow.com
Related Query
- Line is not displayed correctly d3.js geo and google maps
- Svg line not displayed on google charts?
- Edge does not handle scaling and text-anchor:middle correctly in svg
- SVG not drawn outside the visible area of Google Maps
- nvd3 line chart not shown properly. (dots and shaded area)
- tickSizeOuter not equal zero, but just first and last tick of yAxis shows line
- d3 line and area charts not updating with new data array
- Line and Rect intersection not calculated properly on one axis
- How can I make a dynamic line between 2 elements not knowing their positions in x and y?
- D3 line chart does not show tool tip and data points properly
- D3 + Google Maps + Paths + Labels Bug witih Panning and Zooming
- Line chart not hitting the right value on chart and has a smooth line
- D3 line graph getting error and not getting plotted
- D3 Geo map zoom is not working correctly (Canvas)
- Why animated d3 svg line is not synchronized with the axis shift in IE9 but synchronized in IE11 and Chrome?
- Multiple paths with d3.js and google maps API
- d3.hexbin data points not being displayed correctly
- D3.js bar chart not animating correctly and leaving behind artifacts after animation
- d3js - my line graph not working, and throws error
- d3 line chart not displayed properly
- Line not following x os correctly & first tick isn't being shown
- d3.js line graph axis not displaying data correctly
- Circles keep accumulating and are not merging correctly
- plotting the points x and y, the axes y and x are not shown correctly
- X axis label not displayed in bar chart with scroll and zoom feature - d3js, Brushing
- Uncaught TypeError: n is not a function d3.js. While trying to overlay us_map on google maps
- D3js canvas and line are not visible
- Embedded Google Map with d3.js overlay shows UI options and overlay element but NOT the map itself
- Not able to create scatter and line chart together in c3.js
- D3 X Axis Text and Tick Line Not Visible
More Query from same tag
- D3 nested objects should be different colors
- D3.js restore previous color on mouseout
- Is there a malformation in my GeoJSON or a bug in my D3 code?
- what is the best way to update pie chart on hover of bars in a bar chart - d3
- Generating and applying gradient to svg shape with d3
- D3 append (insert) existing SVG string (or element) to a DIV
- D3 Chart print issue
- Add extra tick of the beginning of a d3 time axis
- Filtering element based on existence of child node
- Select the children of a node from a tree in d3.js
- AngularJS DOM modification deletes events -> need viable workaround implementation schema
- D3 Line-Path Intersection
- Draw a map with d3 and topojson
- Add SVG title to plotly chart before downloading PNG
- topojson.object in topojson V1
- SortBy doesn't work in datatable dc.js
- Rendering a multi-line chart in DC.js
- D3 force layout stable detect
- Change Default d3.js colors
- d3 force directed graph, focus on node double click
- polygon weird redrawing by adding & dragging dynamic points (flickering)
- How to position a marker on a map made with the command line tools?
- Embedding csv in HTML for use with D3.js
- Why the line in this D3 chart isn't properly displayed when updated?
- Need to shift link of child node to parent once parent collapsed in d3 graph
- Bar Height change following Y Axis inversion in D3 Charts
- d3-attrTween with custom function.(What did I misunderstand about tween function?)
- d3fc - Add two discontinuityProvider's
- d3.tip is not a function: webpack and typescript
- d3js jumpy zoom behavior