Line chart not hitting the right value on chart and has a smooth line

前端 未结 2 1173
说谎
说谎 2021-01-24 09:48

Below is my line graph where I am using 2 lines to show different values,

One line is blue and the other is red.

I want the line to have sharp points. and i woul

2条回答
  •  抹茶落季
    2021-01-24 10:14

    If you don't want d3 to smooth the edges, you should remove the interpolation from the line generator.

    https://jsfiddle.net/cexLbfnk/3/

    var valueline2 = d3.svg.line()
      .interpolate("basis") // this line needs to go
      .x(function(d) {
        return x(d.date);
      })
      .y(function(d) {
        return y(d.JANSALES);
      });
    

提交回复
热议问题