| |
2011-05-27 19:36:11 2475
|
| jjQuery Plugin Graph (그래프 플러그인) |
 |
호석
|
|
 | 일반 | |
|
http://cshong.tistory.com/270
jQuery - http://jquery.com
jQuery.min.js
Protovis - http://vis.stanford.edu/protovis
Protovis-3.1.zip
1. 원하는 곳에 다음의 자바스크립트 코드를 넣어서 사용한다.
var vis = new pv.Panel()
.width(150)
.height(150);
vis.add(pv.Bar)
.data([1, 1.2, 1.7, 1.5, .7, .3])
.width(20)
.height(function(d) d * 80)
.bottom(0)
.left(function() this.index * 25);
vis.render();
2. 다음과 같이 사용하면 차트에 가이드라인을 사용할 수도 있다.
var vis = new pv.Panel()
.width(150)
.height(150);
vis.add(pv.Rule)
.data(pv.range(0, 2, .5))
.bottom(function(d) d * 80 + .5)
.add(pv.Label);
vis.add(pv.Bar)
.data([1, 1.2, 1.7, 1.5, .7])
.width(20)
.height(function(d) d * 80)
.bottom(0)
.left(function() this.index * 25 + 25)
.anchor("bottom").add(pv.Label);
vis.render();
|
|
|
|
|