flymis/WebRoot/dojojs/src/charting/Chart.js

(开头部分) 2KB

这里只显示每个文件的开头 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.Chart");
dojo.require("dojo.lang.common");
dojo.require("dojo.charting.PlotArea");

dojo.charting.Chart = function(
	/* HTMLElement? */node, 
	/* string? */title, 
	/* string? */description
){
	//	summary
	//	Create the basic Chart object.
	this.node = node || null;
	this.title = title || "Chart";			//	pure string.
	this.description = description || "";	//	HTML is allowed.
	this.plotAreas = [];
};

dojo.extend(dojo.charting.Chart, {
	//	methods
	addPlotArea: function(/* object */obj, /* bool? */doRender){
		//	summary
		//	Add a PlotArea to this chart; object should be in the
		//	form of: { plotArea, (x, y) or (top, left) }
		if(obj.x && !obj.left){ obj.left = obj.x; }
		if(obj.y && !obj.top){ obj.top = obj.y; }
		this.plotAreas.push(obj);
		if(doRender){ this.render(); }
	},
	
	//	events
	onInitialize:function(chart){ },
	onRender:function(chart){ },
	onDestroy:function(chart){ },

	//	standard build methods
	initialize: function(){
		//	summary
		//	Initialize the Chart by rendering it.
		if(!this.node){ 
			dojo.raise("dojo.charting.Chart.initialize: there must be a root node defined for the Chart."); 
		}
		this.destroy();
		this.render();
		this.onInitialize(this);
	},
	render:function(){
		//	summary
		//	Render the chart in its entirety.
		if(this.node.style.position != "absolute"){
			this.node.style.position = "relative";
后面还有 25 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。