Sha256: 7601d53d00b1c6c76e0e99efe23a07b0ceebabd22df583b7268d6ca6207b33d2

Contents?: true

Size: 714 Bytes

Versions: 8

Compression:

Stored size: 714 Bytes

Contents

<html>
  <head>
    <title>Donut</title>
    <script type="text/javascript" src="protovis-r3.3.js"></script>
  </head>
  <body>
    <script type="text/javascript+protovis">

var data = pv.range(10).map(function(x) {return Math.abs(Math.sin(x))}),
    w = 400,
    h = 400,
    r = w / 2,
    t = 30,
    a = pv.Scale.linear(0, pv.sum(data)).range(0, 2 * Math.PI);

var vis = new pv.Panel()
    .width(w)
    .height(h);

vis.add(pv.Wedge)
    .data(data)
    .innerRadius(r - t)
    .outerRadius(r)
    .angle(a)
    .title(function(d) d)
  .anchor("outer").add(pv.Label)
    .visible(function(d) d > .05)
    .textMargin(t + 5)
    .text(function(d) d.toFixed(2));

vis.render();

    </script>
  </body>
</html>

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rubyvis-0.7.0 spec/fixtures/wedge-donut.html
rubyvis-0.6.1 spec/fixtures/wedge-donut.html
rubyvis-0.6.0 spec/fixtures/wedge-donut.html
rubyvis-0.5.2 spec/fixtures/wedge-donut.html
rubyvis-0.5.1 spec/fixtures/wedge-donut.html
rubyvis-0.5.0 spec/fixtures/wedge-donut.html
rubyvis-0.4.1 spec/fixtures/wedge-donut.html
rubyvis-0.4.0 spec/fixtures/wedge-donut.html