javascript - d3.js:Add color to axes dynamically -
i trying create line chart in d3.js.the color of axes chart available @ runtime , can vary in vast set of colors.it possible set colors axes using css classes this.
but since range of colors chart can take vast , available @ runtime, not feasible use solution.using call(yaxis).style("stroke",usercolor)
sets color font use on axes labels , ticks not color of axis itself.
is possible set color of axis in d3.js axis dynamically using javascript?
i think might want following:
d3.selectall('.axis path') .style("stroke", usercolor) .style("fill", usercolor)
in case, .axis path
should identifying css on axis lines (possibly put in d3 in yaxis
function). need 1 of fill
, stroke
, try out see works you. should operate on actual axis line, rather text element
Comments
Post a Comment