不确定确切的“极限线”是什么,但这在视觉上不是问题。首先,我建议这样做:
// (assuming some vars have been created per usual templates)
svg.append( "line" )
.attr("x1", x( x.domain()[0] ) )
.attr("x2", x( x.domain()[1] ) )
.attr("y1", y( 80 ) ) // whatever the y-val should be
.attr("y2", y( 80 ) )
Run Code Online (Sandbox Code Playgroud)
然后添加css或attrs来定义行的特定外观。
请评论任何不适用于您的方式。