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
|
<html>
<head>
<title>Scatterplot</title>
<script type="text/javascript" src="protovis-d3.3.js"></script>
</head>
<body>
<script type="text/javascript+protovis">
var w = 400,
h = 400;
var vis = new pv.Panel()
.width(w)
.height(h)
.margin(20)
.strokeStyle("#ccc");
var dot = vis.add(pv.Dot)
.top(w / 2)
.left(w / 2)
.shapeRadius(w >> 2);
dot.anchor("top").add(pv.Label).text("top");
dot.anchor("left").add(pv.Label).text("left");
dot.anchor("right").add(pv.Label).text("right");
dot.anchor("bottom").add(pv.Label).text("bottom");
dot.anchor("center").add(pv.Label).text("center");
vis.render();
</script>
</body>
</html>
|