flymis/WebRoot/dojojs/src/charting/Series.js
(开头部分) 5KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
http://dojotoolkit.org/community/licensing.shtml
*/
dojo.provide("dojo.charting.Series");
dojo.require("dojo.lang.common");
dojo.require("dojo.charting.Plotters");
dojo.charting.Series = function(/* object? */kwArgs){
// summary
// Create an instance of data series for plotting.
var args = kwArgs || { length:1 };
this.dataSource = args.dataSource || null;
this.bindings = { };
this.color = args.color;
this.label = args.label;
if(args.bindings){
for(var p in args.bindings){
this.addBinding(p, args.bindings[p]);
}
}
};
dojo.extend(dojo.charting.Series, {
bind:function(/* dojo.collections.Store */src, /* object */bindings){
// summary
// Bind this series to src, with bindings.
this.dataSource = src;
this.bindings = bindings;
},
addBinding:function(/* string */name, /* string */binding){
// summary
// Bind to field "binding" using "name".
this.bindings[name] = binding;
},
evaluate:function(/* object? */kwArgs){
// summary
// Evaluate all bindings and return an array of objects describing the bind.
var ret = [];
var a = this.dataSource.getData();
var l = a.length;
var start = 0;
var end = l;
/* Allow for ranges. Can be done in one of two ways:
* 1. { from, to } as 0-based indices
* 2. { length } as num of data points to get; a negative
* value will start from the end of the data set.
* No kwArg object means the full data set will be evaluated
* and returned.
*/
if(kwArgs){
if(kwArgs.from){
后面还有 155 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。