我附上了小提琴,里面有JSON,JS,CSS,HTML- https://jsfiddle.net/mihirchronicles/f9mjqwoa/。目标是使用D3显示给定日期的比特币循环(体积)的低,中和高范围。此外,显示总循环并显示每年的循环。我在D3上绑定数据和缩放时遇到问题。任何帮助都会很棒!
var width = 940, //width
height = 600, //height
tooltip = new CustomTooltip("bitcurve_tooltip", 240), //tooltip
layout_gravity = -0.01, //gravity
damper = 0.1, //moving around nodes
nodes = [], //empty nodes
//these will be set in create_nodes and create_vis
vis = null,
force = null,
circles = null,
radius_scale = null;
range,
lowRange,
aveRange,
highRange;
//defining the center based on width and height
var center = {x: width / 2, y: height / 2};
//defining the area for all the years when split
var year_centers = {
"2011": {x: width / 3, y: height / 2},
"2012": {x: width / 2, y: height / 2},
"2013": {x: 2 * width / 3, y: height / 2}
};