Sha256: 8794b265c5e3f78ddb88a05293d70dce2ba6d26e439f0b44509efbd3d83b56b3

Contents?: true

Size: 922 Bytes

Versions: 1

Compression:

Stored size: 922 Bytes

Contents

<html>
  <head>
    <title>Date Test</title>
    <script type="text/javascript" src="../../protovis-d3.3.js"></script>
    <style type="text/css">

span {
  float: left;
  clear: left;
}
#fig {
  width: 560px;
  margin: auto;
}

    </style>
  </head>
  <body><div id="fig">
    <script type="text/javascript+protovis">

var w = 500,
    h = 10,
    now = new Date().getTime();

var vis = new pv.Panel()
    .data(pv.range(1, 14, .1).map(function(e) Math.pow(10, e)))
    .fillStyle("#ccc")
    .width(w)
    .height(h)
    .bottom(20)
    .left(30)
    .right(30);

vis.add(pv.Rule)
    .def("x", function(t) pv.Scale.linear(new Date(now), new Date(now + t)).range(0, w))
    .data(function() this.x().ticks())
    .strokeStyle("#fff")
    .left(function(d) this.x()(d))
  .anchor("bottom").add(pv.Label)
    .text(function(d) this.anchorTarget().x().tickFormat(d));

vis.render();

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubyvis-0.1.1 vendor/tests/data/scale-date.html