src/main/webapp/student/js/vendor/graphtable/jquery.graphTable-0.3.js
(开头部分) 6KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
(function($) {
$.fn.graphTable = function(_graphArgs,_flotArgs) {
var args = {
/*
* options for reading the table -- defaults will work in most cases except
* you'll want to override the default args.series if your series are in columns
*
* note that anywhere the word "index" is used, the count starts from 0 at
* the top left of the table
*
*/
series: 'rows', // are the series in rows or columns?
labels: 0, // index of the cell in the series row/column that contains the label for the series
xaxis: 0, // index of the row/column (whatever args.series is) that contains the x values
firstSeries: 1, // index of the row/column containing the first series
lastSeries: null, // index of the row/column containing the last series; will use the last cell in the row/col if not set
dataStart: 1, // index of the first cell in the series containing data
dataEnd: null, // index of the last cell in the series containing data; will use the last cell in the row/col if not set
/* graph size and position */
position: 'after', // before the table, after the table, or replace the table
width: null, // set to null to use the width of the table
height: null, // set to null to use the height of the table
min: 0, // defaults to minimum y value in the table
max: 0, // defaults to maximum y value in the table
/* data transformation before plotting */
dataTransform: null, // function to run on cell contents before passing to flot; string -> string
labelTransform: null, // function to run on cell contents before passing to flot; string -> string
xaxisTransform: null, // function to run on cell contents before passing to flot; string -> string
//extra info added by me
colors: null
}
// override defaults with user args
$.extend(true,args,_graphArgs);
/* default to last cell in the row/col for
* lastSeries and dataEnd if they haven't been set yet */
// index of the row/column containing the last series
if (! args.lastSeries) {
args.lastSeries = (args.series == 'columns') ?
$('tr',$(this)).eq(args.labels).find('th,td').length - 1 :
$('tr',$(this)).length - 1;
}
// index of the last cell in the series containing data
if (! args.dataEnd) {
args.dataEnd = (args.series == 'rows') ?
$('tr',$(this)).eq(args.firstSeries).find('th,td').length - 1:
$('tr',$(this)).length - 1;
}
return $(this).each(function() {
// use local min/max for y of each graph, based on initial args
后面还有 119 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
