File: rule-anchor.html

package info (click to toggle)
ruby-rubyvis 0.6.1%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 1,808 kB
  • ctags: 679
  • sloc: ruby: 11,114; makefile: 2
file content (33 lines) | stat: -rw-r--r-- 646 bytes parent folder | download | duplicates (3)
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>Rule Anchor</title>
    <script type="text/javascript" src="protovis-r3.3.js"></script>
    <style type="text/css">span { display: block !important; }</style>
  </head>
  <body>
    <script type="text/javascript+protovis">

var vis = new pv.Panel()
.width(400)
.height(300)


bar=vis.add(pv.Bar)
.data(["left", "top", "right", "bottom", "center"])
    .width(300)
    .height(30)
    .left(40)
    .right(40)
    .top(function() {return this.index*60}).fillStyle('red')

var rule = bar.add(pv.Rule)

rule.anchor(function(d) d).add(pv.Label)
    .text(function(d, p) d);

vis.render();

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