Is there a working implemenation to fit multiple d3 charts like line, bar, etc on one page? [closed]

◇◆丶佛笑我妖孽 提交于 2019-12-13 13:32:07

问题


I am trying to fit multiple charts on a single jsp page. I have a combination of line and bar charts. I am using dimple API for d3.js. Please advice. Bootstrap doesnt seem to work with this.


回答1:


Bootstrap seems to be simple to use:

Add this in your .html file.

<div class="row">
  <div class="col-md-6" id="area1"></div>
  <div class="col-md-6" id="area2"></div>
</div>

Relate the d3 object in the select() to the id in the div tag.

var chart2 = d3.select("#area1").append("svg")
...

var chart2 = d3.select("#area2").append("svg")
...

For more details, just follow the examples in the D3-Tips-and-Tricks book. Section: Using Bootstrap with d3.js



来源:https://stackoverflow.com/questions/24812418/is-there-a-working-implemenation-to-fit-multiple-d3-charts-like-line-bar-etc-o

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!