Discrete Bar Chart colors nvd3.js -


i using nvd3.js discrete bar http://nvd3.org/ghpages/discretebar.html

i inspecting code , seen color been derived inline

style="fill: #ffbb78; stroke: #ffbb78;" 

i track on discretebarchart function

color = nv.utils.getcolor() 

what don't realizing , asking color takes parameter ?

it requires , array of colors => ['#aec7e8', '#7b94b5', '#486192'] , work.

var chart = nv.models.discretebarchart()                    ....                     ....                    .color(['#aec7e8', '#7b94b5', '#486192']); 

nvd3 inherits defaults colurs set d3 here

hope helps.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -