D3对齐轴标签文本

时间:2018-06-28 06:09:08

标签: javascript html css d3.js flask

我需要为Order Book image对齐小节。左侧确实与右侧重叠,我不确定如何放置

//filled with floating point data
var biddata = bidsamount;
var askdata = asksamount;

//left side (bids) graph
var bars =d3.select("#bidsamount").append("div").attr("class","bidchart");
var b = bars.selectAll("div")
  .data(biddata)
  .enter().append("div")
  .style("width", function(d) { return Math.min(d * 2,100) + "px"; })
  .text(function(d) { return d; });

//right side (asks) graph
var bars =d3.select("#asksamount").append("div").attr("class","askchart");
var b = bars.selectAll("div")
  .data(askdata)
  .enter().append("div")
  .style("width", function(d) { return Math.min(d * 2, 100) + "px"; })
.text(function(d) { return d; });

0 个答案:

没有答案