Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nvd3 library, How to customize line chart

Tags:

css

svg

nvd3.js

I'm using nvd3 to draw some stats in my app. I would like to increase the thickness of the line in my charts. How can it be possible ?

Thanks

like image 852
psv Avatar asked Jul 24 '14 09:07

psv


1 Answers

Search for the class, that is responsible for the current stroke-width of your lines. Then insert a rule, that is slightly more specific and change the value for stroke-width there.

In this example from the nvd3 examples, the stroke-width is set by a rule like this:

.nvd3 .nv-groups path.nv-line

So we create a matching rule, which is slightly more specific, e.g.:

.nvd3 g.nv-groups path.nv-line

and attach a new value for stroke-width with it:

.nvd3 g.nv-groups path.nv-line {
  stroke-width: 5px;
}
like image 111
Sirko Avatar answered Nov 15 '22 21:11

Sirko