You need to assign the new scale to the axis. You should also set domain/range for the new scale:
xScale = d3.scale.pow().exponent(2) .domain([0, 10]) .range([50, 350]); vis.select('.xaxis').transition().call(xAxis.scale(xScale));
Complete demo here.
- Change D3 scale from linear to pow by pushing a button
- How do we change the tick values generated by a linear scale in a d3.js line plot?
- Starting linear scale from 1 instead of 0 (D3.js)
- D3 Change color and scale based on radio button
- D3 Applying colour from a linear scale to my data
- Draw new graph on selection of new variable from drop down menu and/or radio button change
- d3 color scale - linear with multiple colors?
- clicking a node in d3 from a button outside the svg
- Use d3 log scale instead of linear scale
- Continuous color scale from discrete domain of strings?
- How to change speed of translate and scale when zooming in and out in D3 (using zoom.on & d3.event.translate, d3.event.zoom)?
- D3.js scale returning wrong values from dataset
- d3.js svg image: scale from center of rectangle
- d3.js: get tick format from time scale
- d3.js - Having a tree layout, how to change the X-axis to use a time scale in D3?
- d3.js linear scale returns NaN
- render d3 linear nice scale with whole numbers only
- custom d3 linear scale that returns null for null values instead of 0
- D3.js using ordinal scale over linear scale
- Change scale default in cubism.js
- Scale rect element from center
- D3.js v5 - Creating a relative, zoomable timeline-like axis on a linear scale
- Multiple maps with d3.js: change values of scale and center
- Change button text using D3js
- nvd3 set scale from big to small
- How to change table cell color based on numeric value from .csv report AND when tables are dynamically created?
- Crosshair / x value tooltip for linear scale
- D3 - Change axis scale on data change
- Disable brush on range chart before selecting a scale from the dropdown/on page load(dc.js,d3.js)
- Changing time scale from days to weeks, how do I update and sum data values?
More Query from same tag
- D3.js graph displaying only one dataset
- Line chart not aligned with x axis
- D3JS: chart resizes when scrolling and down
- d3 tickFormat, remove comma as thousands separator
- Filtering and Ordering in dimplejs visualization
- Missing data means visualization not showing
- d3 extracting a single value from a csv file
- Graph is not taking whole space in d3.js
- Generating a PDF from a HTML page that holds d3js graphs
- D3 map, click and get id from json
- Custom layout in d3.js?
- Remove extra datapoints when reaching end of array
- How to change Horizontal bar chart to vertical bar chart in D3 v4
- Offline / IDE Means of Exporting Graph as SVG or PNG Image
- undefined is not a function epoch js
- Update D3 tree when some nodes are removed
- C3.js Load Function Not Working
- Resize my d3 chart so that it is 100% when the page loads and when you resize the window
- D3.js d3.line giving unexpected results when taking values from an input
- Use d3.json function with variable instead of URL
- Building a line chart using d3.js
- Add path but also text above the path - D3js v3?
- Visualizing a parse tree with d3.js
- Prepare nested JSON data for D3 stacked bar chart
- d3 text doesn't move with the nodes
- D3.js resize and drag
- D3 and SVG namespaces for custom svg elements or attributes to be valid?
- D3 event showing 'ReferenceError: event is not defined' in Firefox