score:5
Accepted answer
You were setting the domain of the y axis as
y.domain([0, d3.max(data, function(d) { return d.y; })]);
which with the log values won't work because all values are less than 0. To fix, simply use
y.domain(d3.extent(data, function(d) { return d.y; }));
instead. You also might want to use a linear scale instead of a time scale for the x axis. Complete jsfiddle here.
Source: stackoverflow.com
Related Query
- d3.js line chart with negative numbers
- Draw Line chart with positive & negative values
- D3.js line chart with negative values
- Bar chart with negative values
- nvd3 line chart with string values on x-axis
- D3.JS time-series line chart with real-time data, panning and zooming
- Multiseries line chart with mouseover tooltip
- NVD3 line chart with realtime data
- javascript charting - nvd3 line chart with two Y-axis
- d3 Line Chart with enter-update-exit logic
- NVD3 line chart with vertical line
- nvd3.js-Line Chart with View Finder: rotate axis labels and show line values when mouse over
- dc.js line chart with range of colors
- Special donut chart with different rings/arcs for positive and negative values
- Line chart using ordinal x-axis with d3.js and nvd3.js
- Draw D3 Simple Line chart With an Array
- Visualize date specific data with a line chart in browser with javascript
- Build D3js Area Chart with negative values
- d3 v4 drag line chart with x and y axes
- Make a chart with area charts having both positive and negative y axis in dc or d3.js
- d3.js stacked bar chart with positive and negative values
- Error in A Simple D3 Line chart with Legend and Tooltips for D3v 3.5.13
- Dimple.js line chart with composite axis, no links between points on series
- Align lines and dots with x-axis values in line chart
- C3js - combination chart with data labels only for line
- add circle in a spiral chart with d3js with line connecting to center
- D3.js: plot dots on the existing line in a multiseries line chart with long formatted data
- How to line up x axis on stacked bar chart with a line overlay in d3.js
- simple multi line chart with D3
- d3js gantt chart with date/time scale at the top and current day blue line
More Query from same tag
- How to add gridlines to d3 realTimeChartMulti?
- 3D bar chart in angular 8 application using either d3.js or plotly or three.js
- Can't change fill of d3.js rectangle
- D3 Only Loading One Cell of Data
- Counting arrays in D3 and getting that number to visualise map points
- D3.JS ticks method not working on x-axis that is using dates
- How to save d3 graph as image on local machine?
- D3 pie chart transition
- D3.js pseudo 3D bar chart
- Changing a pie chart into an arrow ring chart
- How can i get the key of an element in stack-layout in d3?
- d3js Tree square
- Multiple axis to display day and month year with d3 scaleTime
- d3 geo map overflow
- D3 zoom is not properly reseting zoom state and translated location
- How to apply padding between D3 axes and chart?
- Ideas for distinct layering of stacked graph in D3.js
- D3 map not distinguishing click from select text
- d3js make tooltip stay when clicked
- WebCola Missing documentation
- Why am I unable to filter my JSON array in d3.js?
- How to change opacity on second click?
- mercator causing blank d3 page
- Aligning text inside circular arc d3js
- Format labels in D3.js graph
- d3.js - How can I set the cursor to hand when mouseover these elements on SVG container?
- How to change the color of a d3.js axis line
- How to limit animated axis labels position in d3?
- How to extract nominal labels for d3 chart
- Filtering nodes and links of a forced directed graph based on a button click