Project

General

Profile

Statistics
| Revision:

root / trunk / web / dojo / dojox / charting / widget / Sparkline.js @ 12

History | View | Annotate | Download (1.33 KB)

1
/*
2
        Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
3
        Available via Academic Free License >= 2.1 OR the modified BSD license.
4
        see: http://dojotoolkit.org/license for details
5
*/
6

    
7

    
8
if(!dojo._hasResource["dojox.charting.widget.Sparkline"]){
9
dojo._hasResource["dojox.charting.widget.Sparkline"]=true;
10
dojo.provide("dojox.charting.widget.Sparkline");
11
dojo.require("dojox.charting.widget.Chart2D");
12
dojo.require("dojox.charting.themes.ET.greys");
13
(function(){
14
var d=dojo;
15
dojo.declare("dojox.charting.widget.Sparkline",dojox.charting.widget.Chart2D,{theme:dojox.charting.themes.ET.greys,margins:{l:0,r:0,t:0,b:0},type:"Lines",valueFn:"Number(x)",store:"",field:"",query:"",queryOptions:"",start:"0",count:"Infinity",sort:"",data:"",name:"default",buildRendering:function(){
16
var n=this.srcNodeRef;
17
if(!n.childNodes.length||!d.query("> .axis, > .plot, > .action, > .series",n).length){
18
var _1=document.createElement("div");
19
d.attr(_1,{"class":"plot","name":"default","type":this.type});
20
n.appendChild(_1);
21
var _2=document.createElement("div");
22
d.attr(_2,{"class":"series",plot:"default",name:this.name,start:this.start,count:this.count,valueFn:this.valueFn});
23
d.forEach(["store","field","query","queryOptions","sort","data"],function(i){
24
if(this[i].length){
25
d.attr(_2,i,this[i]);
26
}
27
},this);
28
n.appendChild(_2);
29
}
30
this.inherited(arguments);
31
}});
32
})();
33
}