You will have to add the axis using d3.scale function. See this plnkr for working example.
//add x and y axis var x = d3.scale.linear() .range([0, 950]); var y = d3.scale.linear() .range([200, 0]); var xAxis = d3.svg.axis() .scale(x) .orient("bottom"); var yAxis = d3.svg.axis() .scale(y) .orient("left"); x.domain([0, 950]); y.domain([0, 7]); svg.append("g") .attr("class", "x axis") .attr("transform", "translate(20,250)") .call(xAxis); svg.append("g") .attr("class", "y axis") .attr("transform", "translate(20,30)") .call(yAxis);
- How to Add X and Y axis in the pre existing graph using D3
- how to add legend to a pie chart using D3js? And how to centralise the pie chart?
- How can I add images in the nodes of a D3 Sankey diagram, using the rcv and networkD3 packages in R?
- how to add mouse events to force directed graph using the d3 canvas renderer?
- How to properly transpose X and Y axes using the D3 axis commands?
- How to add intervals in the X axis using d3.js?
- How to get a dashed line on Y axis and how to display the value beside the graph in d3
- How do I prevent graph elements from reaching the axis of my graph in D3 and scale properly?
- How to control the space between the start of a bar and the axis in a bar-chart constructed using d3?
- How can I get the D3.js axis ticks and positions as an array?
- how to set the domain and scale on an axis on a nvd3.js multiBarChart
- How can I show a graph using d3 force layout with initial positions set and no movement at all?
- c3 graph in a dark background; how to change axis and tick value color
- How can i get the startAngle and endAngle of each arc in the sunburst example using d3.js?
- how do i add a zoom in and zoom out button in a graph on d3
- How do I create a minimap of an SVG using D3 v5 and show the current viewport dimensions?
- How to add a line graph to a scatterplot using d3?
- How to add a legend and labels to the pie chart?
- D3: How to remove tick marks at the top and bottom of Y axis
- How to visualize the graph using d3Network in R
- How to add a force drag event in D3 and make the node stay where i leave it?
- How do I make a d3.js force directed graph interactive using ajax and python?
- How can I offset the source and target points of a bezier curve using D3's link generator?
- How to remove the comma in D3 axis ticks and remove the last tick?
- D3.js how to get the position/offset of x and y axis
- how to make the x axis scrollable in a d3 line chart graph
- How to increase the space between axis and axis label?
- How do I add a title attribute to the nodes of my force-directed graph generated by d3?
More Query from same tag
- Is there a way to set a default color for the un-selected boxes in heatmap in dc.js when crossfilter is applied?
- d3.js interactive grouped bar chart alternating rotation
- Rendering svg from static assets using d3 in React
- How can i bind an json data with a key and Name for display
- d3 v3 not starting transition on g elements
- How do I apply two svgs on one html page?
- D3.js adding to a Multi-Linegraph path and updating axis
- D3 .bandwidth() returning NaN
- Collapsible indented tree's initial state
- How to get the vertically-oriented tree using d3.js with rectangular box
- Format of json data for D3 bundle layout
- D3.js - How to highlight the biggest and smallest (minimum and max) columns in a bar chart?
- Highlight path in d3 tree is not working in IE
- How can I make multiple D3.js transitions that repeat at an unchanging rate?
- D3 Not able to render a simple line
- d3 text-wrap plugin changes coordinates
- How to move/pan the svg to a certain position?
- How to check d3 js force graph for nodes with no links and remove them?
- d3 - updating data doesnt cause a refresh
- How do I get my D3 map to zoom to a location?
- Saving a SVG, background image is left out
- D3 data binding (two dimensional array)
- D3 V4 assigning a listener to d3.brushX when the element is first rendered
- d3 to create paths based on separate array of data
- polynomial d3-regression loading dataset
- D3 force layout stable detect
- Accessing dimensions of SVG component in Aurelia
- Changes to forceSimulation disable drag
- dc.js Boxplots displaying values