Sha256: b18f9be32a0cec9e941f93ea8dac48a400091603ef70a471fe9b199732ce7c62
Contents?: true
Size: 1.27 KB
Versions: 1
Compression:
Stored size: 1.27 KB
Contents
<html> <head> <title>Area Chart - Cardinal</title> <script type="text/javascript" src="../../protovis-d3.3.js"></script> </head> <body> <script type="text/javascript+protovis"> var data = pv.range(0, 10.1).map(function(x) { return {x: x, y: 1/(1+Math.exp(-x+5)) * 4}; }), w = 400, h = 200, x = pv.Scale.linear(data, function(d) d.x).range(0, w), y = pv.Scale.linear(0, 4.1).range(0, h); var vis = new pv.Panel() .width(w) .height(h) .bottom(20) .left(20) .right(10) .top(5) .strokeStyle("#ccc"); vis.add(pv.Rule) .data(y.ticks()) .visible(function() !(this.index % 2)) .bottom(function(d) Math.round(y(d)) - .5) .strokeStyle("#eee") .anchor("left").add(pv.Label) .text(function(d) d.toFixed(1)); vis.add(pv.Rule) .data(x.ticks()) .visible(function(d) d > 0) .left(function(d) Math.round(x(d)) - .5) .strokeStyle("#eee") .anchor("bottom").add(pv.Label) .text(function(d) d.toFixed()); vis.add(pv.Area) .data(data) .left(function(d) x(d.x)) .bottom(0) .height(function(d) y(d.y)) .fillStyle("rgba(31,119,180,.6)") .interpolate("monotone") .tension(.6) .anchor("top").add(pv.Line) .lineWidth(3); vis.render(); </script> </body> </html>
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rubyvis-0.1.1 | vendor/tests/mark/area-monotone.html |