D3.js line chart: axis with fixed position

后端 未结 2 1677
北海茫月
北海茫月 2021-01-28 11:17

i got a normal line chart written in d3.js

body {
    font: 10px sans-serif;
}

.axis path,
.axis line {
    fill: none;
    stroke: #000;
    shape-rendering: c         


        
2条回答
  •  北恋
    北恋 (楼主)
    2021-01-28 11:22

    Try applying the style when you generate the axis.

    svg.append("g")
            .attr("class", "x axis")
            .attr("transform", "translate(0," + height + ")")
            .style("position", "fixed")
            .call(xAxis);
    

提交回复
热议问题