how to apply color to my axes in d3?

拟墨画扇 提交于 2019-12-25 04:15:30

问题


I am new to d3. I created an axes in d3 and its working fine but i can't set color to my axes. I tried fill:none but it doesn't work for me. Here is the jsfiddle link

http://jsfiddle.net/untnht4u/

回答1:


You can color your axis with CSS. You can set class to the axis as shown below:

var xAxisGroup = svgContainer.append("g")
    .attr("class", "axis")
    .call(xAxis);

and on the css add class

.axis path, .axis line {
        fill: none;
        stroke: red;
        shape-rendering: crispEdges;
    }

working example here



来源:https://stackoverflow.com/questions/32154551/how-to-apply-color-to-my-axes-in-d3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!