简体   繁体   中英

D3 v4 breaking on interpolate function

I am trying to understand why D3 v4 is no longer compatible with my script. I think this is because some functions have been deprecated and are no longer in use.

This fiddle no longer works with D3 v4. I think this is due to the following line:

var d3LineBasis = d3.svg.line().interpolate("basis");

I have tried using d3.curveBasis as found on this link , but it has not resolved the issue and the script is not running.

Try curves :

var line = d3
    .line()
    .x(function (d) { return x(d.date); })
    .y(function (d) { return y(d.price); })
    .curve(d3.curveNatural);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM