root / trunk / web / dojo / dojox / charting / scaler / primitive.js @ 10
History | View | Annotate | Download (895 Bytes)
1 | 9 | andrej.cim | /*
|
---|---|---|---|
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.scaler.primitive"]){ |
||
9 | dojo._hasResource["dojox.charting.scaler.primitive"]=true; |
||
10 | dojo.provide("dojox.charting.scaler.primitive");
|
||
11 | dojox.charting.scaler.primitive={buildScaler:function(_1,_2,_3,_4){ |
||
12 | if(_1==_2){
|
||
13 | _1-=0.5;
|
||
14 | _2+=0.5;
|
||
15 | } |
||
16 | return {bounds:{lower:_1,upper:_2,from:_1,to:_2,scale:_3/(_2-_1),span:_3},scaler:dojox.charting.scaler.primitive}; |
||
17 | },buildTicks:function(_5,_6){ |
||
18 | return {major:[],minor:[],micro:[]}; |
||
19 | },getTransformerFromModel:function(_7){ |
||
20 | var _8=_7.bounds.from,_9=_7.bounds.scale;
|
||
21 | return function(x){ |
||
22 | return (x-_8)*_9;
|
||
23 | }; |
||
24 | },getTransformerFromPlot:function(_a){ |
||
25 | var _b=_a.bounds.from,_c=_a.bounds.scale;
|
||
26 | return function(x){ |
||
27 | return x/_c+_b;
|
||
28 | }; |
||
29 | }}; |
||
30 | } |