Sha256: 79e725624f80eb73e3369455a45b613987ad1e644c43c2a3eeade3cab2b40562
Contents?: true
Size: 1.01 KB
Versions: 1
Compression:
Stored size: 1.01 KB
Contents
<html> <head> <title>Ordinal Split Banded</title> <script type="text/javascript" src="../../protovis-d3.3.js"></script> </head> <body> <script type="text/javascript+protovis"> var categories = "ABCDEFGHIJK".split(""), data = categories.map(function(c) ({x:c, y:Math.random()})), w = 480, h = 400, x = pv.Scale.ordinal(categories).splitBanded(0, w, 2 / 3), y = pv.Scale.linear(0, 1).range(0, h), c = pv.Colors.category19(categories); var vis = new pv.Panel() .width(w) .height(h) .margin(19.5) .strokeStyle("#ccc"); vis.add(pv.Bar) .data(data) .left(function(d) x(d.x)) .width(x.range().band) .bottom(0) .height(function(d) y(d.y)) .fillStyle(function(d) c(d.x)) .anchor("bottom").add(pv.Label) .textBaseline("top") .text(function(d) d.x); vis.add(pv.Rule) .data(y.ticks()) .bottom(y) .strokeStyle("rgba(255, 255, 255, .5)") .anchor("right").add(pv.Label) .text(y.tickFormat); vis.render(); </script> </body> </html>
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rubyvis-0.1.1 | vendor/tests/data/ordinal-split-banded.html |