d3 / d3-axis

Human-readable reference marks for scales.

Home Page:https://d3js.org/d3-axis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Default Fonts Being Applied to Axis Container

LeeGDavis opened this issue · comments

D3: 4.7.4
Chrome: 57.0.2987.133 (64-bit)
OS: Win 10x64, Ubuntu 16.10

We are transitioning to D3 v4 and have noticed that the axis containers are receiving a default font and size, font-size="10" font-family="sans-serif", which is clobbering our desired inherited styles.

Is this expected behaviour?

Actually looking at the D3 Changes is this representative of the default styles and shorter syntax? I basically want to understand if this is normative?

If you don’t want these styles, you can either remove the attributes after rendering the axis (see the axis styling example), or you may be able to modify your stylesheet so that your styles take precedence over the attributes.

Please use Stack Overflow tag d3.js to ask for help. Although I make an effort to assist everyone that asks, I am not always available to provide help promptly or directly. Stack Overflow provides a better collaborative forum for self-help: tens of thousands of D3-related questions have already been asked there, and some answered questions may be relevant to you.

When asking for help, please include a link to a live example that demonstrates the issue, preferably on bl.ocks.org. It is often impossible to debug from code snippets alone. Isolate the issue and reduce your code as much as possible before asking for help. The less code you post, the easier it is for someone to debug, and the more likely you are to get a helpful response.

If you have a question about D3’s behavior and want to discuss it with other users, also consider the d3-js Google Group or joining the d3-js Slack.

Thank you! 🤗

Much appreciated, thanks @mbostock ! I'll certainly move questions over to those other venues.