我希望能夠通過 d3js 庫用鉛筆在散點圖中選擇資料。
我發現了以下示例 - https://jsfiddle.net/3mjduntb/ - 但只能用矩形刷。
來源:https ://d3-graph-gallery.com/graph/interactivity_brush.html
我可以看到刷機的API:
// Add brushing
svg
.call( d3.brush() // Add the brush feature using the d3.brush function
.extent( [ [0,0], [width,height] ] ) // initialise the brush area: start at 0,0 and finishes at width,height: it means I select the whole graph area
.on("start brush", updateChart) // Each time the brush selection changes, trigger the 'updateChart' function
)
我找不到任何方法如何修改此選擇方法?
uj5u.com熱心網友回復:
我發現這個插件正是我需要的:
https://bl.ocks.org/skokenes/a85800be6d89c76c1ca98493ae777572
它是 d3.js 插件中的套索插件。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/506790.html
標籤:javascript d3.js 散点图
上一篇:VueJs Axios D3.js“錯誤:太晚了;已經在運行”
下一篇:d3.js條形圖-Y軸NaN
