1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
<html>
<head>
<title>Grid Layout</title>
<script type="text/javascript" src="protovis-d3.3.js"></script>
</head>
<body>
<script type="text/javascript+protovis">
var vis = new pv.Panel()
.data(["A"])
.width(800)
.height(800)
.margin(10)
.fillStyle("#eee")
.strokeStyle("#ccc");
vis.add(pv.Layout.Grid)
.rows(3)
.cols(3)
.cell.add(pv.Layout.Grid)
.rows(pv.index)
.cols(pv.index)
.cell.add(pv.Bar)
.strokeStyle("#fff")
.anchor("center").add(pv.Label)
.textStyle("rgba(255, 255, 255, .4)")
.font("24px sans");
vis.render();
</script>
</body>
</html>
|