flymis/WebRoot/dojojs/src/charting/svg/Axis.js
(开头部分) 7KB这里只显示每个文件的开头 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.svg.Axis");
dojo.require("dojo.lang.common");
dojo.extend(dojo.charting.Axis, {
renderLines: function(
/* dojo.charting.PlotArea */plotArea,
/* dojo.charting.Plot */plot,
/* string */plane
){
// summary
// Renders any reference lines for this axis.
if(this.nodes.lines){
while(this.nodes.lines.childNodes.length > 0){
this.nodes.lines.removeChild(this.nodes.lines.childNodes[0]);
}
if(this.nodes.lines.parentNode){
this.nodes.lines.parentNode.removeChild(this.nodes.lines);
this.nodes.lines = null;
}
}
var area = plotArea.getArea();
var g = this.nodes.lines = document.createElementNS(dojo.svg.xmlns.svg, "g");
g.setAttribute("id", this.getId()+"-lines");
for(var i=0; i<this._labels.length; i++){
if (this._labels[i].value == this.origin){ continue; }
var v = this.getCoord(this._labels[i].value, plotArea, plot);
var l=document.createElementNS(dojo.svg.xmlns.svg, "line");
l.setAttribute("style","stroke:#999;stroke-width:1px;stroke-dasharray:1,4;");
if(plane == "x"){
l.setAttribute("y1",area.top);
l.setAttribute("y2",area.bottom);
l.setAttribute("x1",v);
l.setAttribute("x2",v);
}
else if (plane == "y"){
l.setAttribute("y1",v);
l.setAttribute("y2",v);
l.setAttribute("x1",area.left);
l.setAttribute("x2",area.right);
}
g.appendChild(l);
}
return g; // SVGGElement
},
renderTicks: function(
/* dojo.charting.PlotArea */plotArea,
/* dojo.charting.Plot */plot,
/* string */plane,
后面还有 164 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。