TopAxisLayout.js revision 4beb671b9f23325489cc74a7950f2b1f1420b5f3
/**
* Contains algorithms for rendering a top axis.
*
* @class TopAxisLayout
* @constructor
*/
function TopAxisLayout(config)
{
}
TopAxisLayout.ATTRS = {
/**
* @private
*/
axisRenderer: {
value: null
},
/**
* @protected
*
* Length in pixels of largest text bounding box. Used to calculate the height of the axis.
*
* @attribute maxLabelSize
* @type Number
*/
maxLabelSize: {
value: 0
}
};
/**
* @protected
*
* Sets the length of the tick on either side of the axis line.
*
* @method setTickOffsets
*/
setTickOffsets: function()
{
switch(display)
{
case "inside" :
break;
case "outside" :
break;
case "cross":
break;
}
},
/**
* @protected
*
* Calculates the coordinates for the first point on an axis.
*
* @method getLineStart
*/
getLineStart: function()
{
if(display === "outside")
{
pt.y += tickLength;
}
else if(display === "cross")
{
}
return pt;
},
/**
* @protected
*
* Draws a tick
*
* @method drawTick
* @param {Object} pt hash containing x and y coordinates
* @param {Object} tickStyles hash of properties used to draw the tick
*/
{
},
/**
* @protected
*
* Calculates the point for a label.
*
* @method getLabelPoint
* @param {Object} pt hash containing x and y coordinates
* @return Object
*/
getLabelPoint: function(pt)
{
},
/**
* @protected
*
* @method updateMaxLabelSize
* @param {HTMLElement} label to measure
*/
updateMaxLabelSize: function(label)
{
max;
if(!document.createElementNS)
{
}
else
{
if(rot === 0)
{
}
else if(absRot === 90)
{
}
else
{
}
}
},
/**
* @protected
*
* Rotate and position labels.
*
* @method positionLabel
* @param {HTMLElement} label to rotate position
* @param {Object} pt hash containing the x and y coordinates in which the label will be positioned
* against.
*/
{
margin = 0,
leftOffset = pt.x,
m11,
m12,
m21,
m22,
{
}
if(!document.createElementNS)
{
m11 = cosRadians;
if(rot === 0)
{
topOffset -= labelHeight;
}
else if(absRot === 90)
{
topOffset -= labelWidth;
}
else if(rot > 0)
{
leftOffset -= (cosRadians * labelWidth) + Math.min((sinRadians * labelHeight), (rot/180 * labelHeight));
}
else
{
}
{
filterString = "progid:DXImageTransform.Microsoft.Alpha(Opacity=" + Math.round(labelAlpha * 100) + ")";
}
if(rot !== 0)
{
if(filterString)
{
filterString += " ";
}
else
{
filterString = "";
}
filterString += 'progid:DXImageTransform.Microsoft.Matrix(M11=' + m11 + ' M12=' + m12 + ' M21=' + m21 + ' M22=' + m22 + ' sizingMethod="auto expand")';
}
if(filterString)
{
}
return;
}
if(rot === 0)
{
topOffset -= labelHeight;
}
else if(rot === 90)
{
topOffset -= labelWidth;
}
else if(rot === -90)
{
topOffset -= 0;
}
else if(rot < 0)
{
}
else
{
}
},
/**
* @protected
*
* Calculates the size and positions the content elements.
*
* @method setSizeAndPosition
*/
setSizeAndPosition: function()
{
if(display === "outside")
{
}
else if(display === "cross")
{
}
{
}
},
/**
* @protected
*
* Adjusts position for inner ticks.
*
* @method offsetNodeForTick
* @param {Node} cb contentBox of the axis
*/
offsetNodeForTick: function(cb)
{
if(display === "inside")
{
}
else if (display === "cross")
{
}
else
{
}
},
/**
* @protected
*
* Assigns a height based on the size of the contents.
*
* @method setCalculatedSize
*/
setCalculatedSize: function()
{
}
});