Thanks to visit codestin.com
Credit goes to github.com

Skip to content

An option to generate grid lines #81

@mbostock

Description

@mbostock

This is another frequent pattern:

svg.append("g")
      .attr("transform", `translate(${marginLeft},0)`)
      .call(yAxis)
      .call(g => g.selectAll(".tick line").clone()
          .attr("x2", width - marginLeft - marginRight)
          .attr("stroke-opacity", 0.1))

It’d be nice if this were an option you could pass to the axis, especially for transitions. Note that you’ll need to tell the axis how long the grid lines need to be (width - marginLeft - marginRight).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions