score:0
Accepted answer
You need to set the domains of the scales.
var x = d3.time.scale().domain(d3.extent(data, function(d) { return parseDate(d.time); }))
.range([0, width]);
var y = d3.scale.linear().domain(d3.extent(data, function(d) { return d.level_1; }))
.range([height, 0]);
Complete jsfiddle here.
Source: stackoverflow.com
Related Query
- How to draw a Bar Chart with time on xAxis and one or more numeric data for yAxis in d3js?
- Specifying Ticks on D3 Bar chart with Time Series data and scaleBand
- 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
- How to update d3.js bar chart with new data
- How to use x and width in a bar chart with scaleTime?
- How do I implement d3's enter update exit pattern for an area chart with focus and context?
- how to zoom d3.js chart and reload data with greater granularity (in AJAX)
- d3 show labels only for ticks with data in a bar chart
- D3 - How to loop through an object with keys for a bar chart
- D3 how to draw chart with a x data between two y data
- Grouped bar chart with zoom and updateable data error
- How to increase time to read d3.json data for large data set and slow networks?
- Stacked Bar Chart with Time Series Data
- How to display d3 bubbles in different colors for a dataset with one branch and many children?
- How can i bind an json data with a key and Name for display
- Use a jquery type slider to iterate through a csv and display one bar at a time in a d3.js bar chart
- d3.js - How to do data mapping and filter for Stacked Bar graph
- How do you get JSON data and create a line chart with d3.js?
- How to draw multiple bars in a row in a bar chart with spaces in between with d3v5?
- D3 Bar Chart with Variable X and Y(variable width and height for bars)
- Generating a simple bar chart with d3.js and an array of form data
- How do I plot data on different x-axes and scales with d3.js? And keep it linked for brushes/tooltips?
- How to integrate dc.js with d3 horizon chart for data rendering?
- How to create a d3 stacked bar chart that only iterates through columns 1 and 2 of data file?
- How can I create a basic bar chart with unique counts on the y axis and a category on the x axis?
- How to draw a 3d bar chart on a world map with d3.js?
- d3.js How to draw a directed graph with one node start and one node end
- D3.JS how to load 3 csv files and change data on line chart with button click event?
- How to put data on line chart when x axis and data has a time range
- Showing a bar chart with expected value and current value for a series
More Query from same tag
- How to access JSON data with D3.js?
- D3.js: Using images (with filenames specified in data) as tick values on axis
- Type definition of object in d3.js version 5?
- Bring selected arc hovered over by user to front and dim the display of all other arcs
- Understanding and rebuilding overload of a dataframe to d3 format
- D3.js multiple y-Axis with same position of ticks?
- How to properly add padding to the plot area in a D3 line chart?
- How to attach nodes and links to simulation force in d3js version 4?
- D3.js nodes set bgcolor from array but never adjacent
- D3 updating local data and redrawing pie as it is updated
- Interactive bar chart domain issue
- How to "dump" points selected with the LinkedBrush plugin for mpld3?
- D3.js Combined Bar and Line Chart x-Axis Misalignement Issue
- How to highlight the similarity of the value between rows and columns?
- How to wrap a heatmap on a spiral (seasonal spiral) - d3?
- Prevent trailing zero with pandas "to_csv"
- force-directed d3.js add edge labels
- d3 trying to open html in div or iframe on click
- Ad hoc D3 function
- D3.js-how to clip area outside rectangle while zooming in a grouped bar chart
- Using data from d3.js outside
- How to include Bootstrap Glyphicon in an SVG
- D3 Label to draggable circle
- Accessing nested data in D3
- d3.html not working with d3.v4
- Area fill for realtime graph
- Conver date time string to D3 date time
- d3 append and enter issues
- Get the data from a GET request before rendering D3.js graph
- d3 histogram and barchart data