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

not able to add custom attributes to the axis

shivasai09 opened this issue · comments

we now that using axisBottom or axisRight or any other axis making function, we get the below HTML,
image

but my concern is how to add custom attributes to the <line> or <text> elements.

I need this to increase the accessibility for our product. if it is possible to add custom attributes to <line> or <text>, then i would like to add the aria-* attributes to it so, that my screen reader will be able to give more descriptive information.

can any one help me how to achieve this.?

Thanks,
Siva

You can call a function after applying an axis, see https://observablehq.com/@d3/connected-scatterplot#xAxis for an example.