TopAxisLayout.js revision e393eced613f9b4a5fb6bdd461d0e0bf5064d5ec
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp * Contains algorithms for rendering a top axis.
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp TopAxisLayout.superclass.constructor.apply(this, arguments);
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp * Sets the length of the tick on either side of the axis line.
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp case "inside" :
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp case "outside" :
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp case "cross":
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp * Calculates the coordinates for the first point on an axis.
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp * Draws a tick
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp * Calculates the point for a label.
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp sinRadians = parseFloat(parseFloat(Math.sin(absRot * radCon)).toFixed(8)),
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp cosRadians = parseFloat(parseFloat(Math.cos(absRot * radCon)).toFixed(8)),
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp label.style.filter = "progid:DXImageTransform.Microsoft.BasicImage(rotation=" + rot + ")";
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp this.set("maxLabelSize", Math.max(this.get("maxLabelSize"), label.offsetHeight));
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp max = (sinRadians * label.offsetWidth) + (cosRadians * label.offsetHeight);
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp this.set("maxLabelSize", Math.max(this.get("maxLabelSize"), max));
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp sinRadians = parseFloat(parseFloat(Math.sin(absRot * radCon)).toFixed(8)),
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp cosRadians = parseFloat(parseFloat(Math.cos(absRot * radCon)).toFixed(8)),
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp leftOffset -= (cosRadians * label.offsetWidth) + Math.min((sinRadians * label.offsetHeight), (rot/180 * label.offsetHeight));
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp topOffset -= (sinRadians * label.offsetWidth) + (cosRadians * (label.offsetHeight));
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp leftOffset -= sinRadians * (label.offsetHeight * 0.5);
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp topOffset -= (sinRadians * label.offsetWidth) + (cosRadians * (label.offsetHeight));
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp filterString = "progid:DXImageTransform.Microsoft.Alpha(Opacity=" + Math.round(labelAlpha * 100) + ")";
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp filterString += 'progid:DXImageTransform.Microsoft.Matrix(M11=' + m11 + ' M12=' + m12 + ' M21=' + m21 + ' M22=' + m22 + ' sizingMethod="auto expand")';
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp leftOffset -= (sinRadians * (label.offsetHeight * 0.6));
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp leftOffset -= (cosRadians * label.offsetWidth) - (sinRadians * (label.offsetHeight * 0.6));
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp topOffset -= (sinRadians * label.offsetWidth) + (cosRadians * label.offsetHeight);
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp label.style.webkitTransform = "rotate(" + rot + "deg)";
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp * Calculates the size and positions the content elements.
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp ar.get("contentBox").setStyle("top", labelSize + "px");
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp cb.setStyle("marginBottom", (0 - (tickLength * 0.5)) + "px");