3
votes

I would like to make a line chart with nvd3(which is a collection of re-usable charts made with d3.js), which has y and x axis represented by a line.

Here is the line chart example from the official nvd3 site:

http://nvd3.org/examples/line.html

I would like something like this, where the X axis line displayed:

http://i.imgur.com/m4JfqWl.png?1

Has nvd3 any options for that? Is it even possible? Thanks.

2

2 Answers

6
votes

It looks like it's controlled by this CSS rule (nv.d3.css line 225):

.nvd3 .nv-axis.nv-x path.domain {
  stroke-opacity: 0;
}

Overriding that with your own CSS should show the line (at least, changing the value to 1 in the developer tools worked for me).

2
votes
.nvd3 .nv-axis.nv-x path.domain, .nvd3 .nv-axis.nv-y path.domain {
  stroke: black;
  shape-rendering: crispEdges;
}