score:1
Accepted answer
first, separate the code of axis from its parts:
const axisbottom = d3.axisbottom(x)
.tickformat(d3.timeformat("%b"));
const axisbottomg = svg.append("g")
.attr("transform", "translate(0," + height + ")")
.call(axisbottom);
axisbottomg.classed('axisgrey', true);
axisbottomg.selectall("text")
.attr("y", 0)
.attr("x", 9)
.attr("dy", ".35em")
.attr("transform", "rotate(45)")
.style("text-anchor", "start");
then, inspect (f12) axis <g>
element to make sure it has axisgrey
class and has the class styles as well.
Source: stackoverflow.com
Related Query
- Changing the color of an axis line in a D3 chart
- dimple.js How can I change the labels of a chart axis without changing the data?
- how to make the x axis scrollable in a d3 line chart graph
- Changing color range in a d3 reusable donut chart depending on the number of data points
- How to change the color of a d3.js axis line
- dc/d3 line chart crashing down to 0 on the y axis after filtering
- Changing the colors of each of the Stacked Bar chart with different Color in D3
- How to zoom only on the X axis in a line chart in d3.js (v7)
- change the color of the lines in the line chart vegalite
- NVD3 Cumulative Line Chart : How to set different back ground color for specific X axis
- Adding axis to the dynamic line chart in d3
- D3.js line chart - can't see line close to the axis
- On making chart responsive the x,y axis line disappears
- How to rotate the text labels for the x Axis of a nvd3.js line chart
- nvd3 line chart - set the color of the line by Y value
- Color the area formed between Line Chart and Threshold line
- d3.js axis labels - color not changing
- D3: Create a continuous color scale with many strings/inputs for the range and dynamically changing values of the domain
- How to customize the color scale in a D3 line chart?
- D3 line chart axis text labels in multi line
- Make simple bar chart using C3 with separate columns on the x axis
- How to change line color in d3js according to axis value?
- Looking for a better way to alter the color of axis components in d3.js v4
- Draw a vertical line representing the current date in d3 gantt chart
- nvd3.js-Line Chart with View Finder: rotate axis labels and show line values when mouse over
- NVD3 Line Chart X Axis Ticks Are Missing
- How can I set the each line color or width in SVG path
- D3.js: Changing the color of the bar depending on the value
- nvd3.js - unable to change color of line in line chart
- How to plot animated line chart using d3 while the data table is required to be updated every 1 second?
More Query from same tag
- Formatting in JSON File to be used in D3.js
- d3.js - set links size to a force layout
- What HTML processing is used on observablehq?
- How to set Chart dimensions to change as per given data
- Resize SVG contents based on the result of rendering
- d3 force directed graph don't select text
- return a global variable in d3.js
- Rotate element thrown outside the SVG
- Delay animated arcs with .attrTween method
- How to Align D3.js X-axis Dates with Supplied Data
- Use variable to call data column in dataset d3.js
- Rotate a rectangle on dragging event D3
- How to toggle lines in a line chart using a legend
- How to customize the color scale in a D3 line chart?
- Scrollbar on svg zoom
- The legend is not displayed correctly (text cut off) You can test it with jsbin
- "stroke-dasharray:x,y;" mess up svg path? (Chrome)
- Custom time interval infinitely looping
- D3 How to zoom in on SVG text that stays within an SVG Rectangle?
- D3 single line chart with tsv data
- D3.js force layout slow in IE 9
- How to set Position for marker-start?
- Dynamic Node Addition/Updation on D3 js Network Graph on button click
- Call function to set D3 SVG rect attributes just once for each datum
- Confused by d3.js's event dispatch
- How to get the boundaries of currently visible time scale (after panning and zooming)?
- d3.geoPath().projection is rendering black rectangle instead of map
- adding graphics after labels in d3js tree
- Epoch Time conversion with D3
- Proper data structure for d3 nodes