Html 自举不';I don’我不允许在其他库中使用数据
我有一个SQL数据库,我正在visual studio for web中构建一个web服务。我正在使用bootstrap来构造我的web表单,并使用D3plus来可视化。我编写了以下测试样本:Html 自举不';I don’我不允许在其他库中使用数据,html,twitter-bootstrap,d3.js,d3plus,Html,Twitter Bootstrap,D3.js,D3plus,我有一个SQL数据库,我正在visual studio for web中构建一个web服务。我正在使用bootstrap来构造我的web表单,并使用D3plus来可视化。我编写了以下测试样本: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <link href="C
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link href="Content/bootstrap.min.css" rel="stylesheet"/>
<script src="scripts/d3.js"></script>
<script src="scripts/d3plus.js"></script>
</head>
<body>
<form id="form1" runat="server">
<div class="col-lg-6">
<div id="exports"></div>
</div>
<script>
// sample data array
var trade_data = [
{"usd": 34590873460, "product": "Oil"},
{"usd": 12897429187, "product": "Cars"},
{"usd": 8974520985, "product": "Airplanes"},
{"usd": 9872342, "product": "Apples"},
{"usd": 6897234098, "product": "Shoes"},
{"usd": 590834587, "product": "Glass"},
{"usd": 987234261, "product": "Horses"}
]
// instantiate d3plus
var visualization = d3plus.viz()
.container("#exports")
.data(trade_data)
.type("tree_map")
.id("product")
.size("usd")
.labels({"align": "left", "valign": "top"})
.draw()
</script>
</form>
</body>
</html>
//样本数据数组
var交易数据=[
{“美元”:34590873460,“产品”:“石油”},
{“usd”:12897429187,“产品”:“汽车”},
{“usd”:8974520985,“产品”:“飞机”},
{“usd”:9872342,“产品”:“苹果”},
{“usd”:6897234098,“产品”:“鞋”},
{“usd”:590834587,“产品”:“玻璃”},
{“usd”:987234261,“产品”:“马”}
]
//实例化d3plus
var可视化=d3plus.viz()
.集装箱(“出口”)
.数据(贸易数据)
.type(“树图”)
.id(“产品”)
.规模(“美元”)
.标签({“align”:“left”,“valign”:“top”})
.draw()
基本上,我希望图形位于屏幕宽度一半的容器中。如果我不嵌套
导出
,则该图可以工作。但是,如果嵌套它,则找不到数据。我是不是犯了一个明显的错误?我非常感谢社区的反馈。谢谢大家! 引导col
中的css最小高度为1px<代码>d3plus正在解析此高度,然后无法在1px中呈现图表。可以通过指定为显式高度来解决此问题:
//样本数据数组
var交易数据=[
{“美元”:34590873460,“产品”:“石油”},
{“usd”:12897429187,“产品”:“汽车”},
{“usd”:8974520985,“产品”:“飞机”},
{“usd”:9872342,“产品”:“苹果”},
{“usd”:6897234098,“产品”:“鞋”},
{“usd”:590834587,“产品”:“玻璃”},
{“usd”:987234261,“产品”:“马”}
]
//实例化d3plus
var可视化=d3plus.viz()
.集装箱(“出口”)
.数据(贸易数据)
.type(“树图”)
.id(“产品”)
.规模(“美元”)
.标签({“align”:“left”,“valign”:“top”})
.高度(250)//