/**
* Contains algorithms for rendering a bottom axis.
*
* @module charts
* @class BottomAxisLayout
* @Constructor
*/
BottomAxisLayout = function(){};
/**
* Default margins for text fields.
*
* @private
* @method _getDefaultMargins
* @return Object
*/
_getDefaultMargins: function()
{
return {
top: 4,
left: 0,
right: 0,
bottom: 0
};
},
/**
* Sets the length of the tick on either side of the axis line.
*
* @method setTickOffsets
* @protected
*/
setTickOffsets: function()
{
var host = this,
switch(display)
{
case "inside" :
break;
case "outside" :
break;
case "cross":
break;
default:
break;
}
},
/**
* Calculates the coordinates for the first point on an axis.
*
* @method getLineStart
* @protected
*/
getLineStart: function()
{
if(display === "inside")
{
pt.y += tickLength;
}
else if(display === "cross")
{
}
return pt;
},
/**
* Draws a tick
*
* @method drawTick
* @param {Path} path reference to the path `Path` element in which to draw the tick.
* @param {Object} pt hash containing x and y coordinates
* @param {Object} tickStyles hash of properties used to draw the tick
* @protected
*/
{
var host = this,
},
/**
* Calculates the point for a label.
*
* @method getLabelPoint
* @param {Object} pt Object containing x and y coordinates
* @return Object
* @protected
*/
getLabelPoint: function(point)
{
},
/**
* Updates the value for the `maxLabelSize` for use in calculating total size.
*
* @method updateMaxLabelSize
* @param {HTMLElement} label to measure
* @protected
*/
{
var host = this,
props = this._labelRotationProps,
max;
if(rot === 0)
{
max = labelHeight;
}
else if(absRot === 90)
{
max = labelWidth;
}
else
{
}
},
/**
* Determines the available label height when the axis width has been explicitly set.
*
* @method getExplicitlySized
* @return Boolean
* @protected
*/
getExplicitlySized: function(styles)
{
if(this._explicitHeight)
{
var host = this,
h = host._explicitHeight,
return true;
}
return false;
},
/**
* Rotate and position title.
*
* @method positionTitle
* @param {HTMLElement} label to rotate position
* @protected
*/
positionTitle: function(label)
{
var host = this,
{
}
props.x = x;
props.y = y;
},
/**
* 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.
* @protected
*/
{
var host = this,
margin = 0,
{
}
if(rot > 0)
{
}
else if(rot < 0)
{
leftOffset -= labelWidth;
}
else
{
}
topOffset += tickOffset;
props.x = leftOffset;
},
/**
* Adjusts the coordinates of an axis label based on the rotation.
*
* @method _setRotationCoords
* @param {Object} props Coordinates, dimension and rotation properties of the label.
* @protected
*/
_setRotationCoords: function(props)
{
if(rot > 0)
{
leftOffset = 0;
}
else if(rot < 0)
{
}
else
{
topOffset = 0;
}
props.x -= leftOffset;
},
/**
* Returns the transformOrigin to use for an axis label based on the position of the axis
* and the rotation of the label.
*
* @method _getTransformOrigin
* @param {Number} rot The rotation (in degrees) of the label.
* @return Array
* @protected
*/
_getTransformOrigin: function(rot)
{
var transformOrigin;
if(rot > 0)
{
}
else if(rot < 0)
{
}
else
{
}
return transformOrigin;
},
/**
* Adjusts position for inner ticks.
*
* @method offsetNodeForTick
* @param {Node} cb contentBox of the axis
* @protected
*/
offsetNodeForTick: function(cb)
{
var host = this;
},
/**
* Assigns a height based on the size of the contents.
*
* @method setCalculatedSize
* @protected
*/
setCalculatedSize: function()
{
var host = this,
ttl = Math.round(host.get("bottomTickOffset") + host._maxLabelSize + labelStyle.margin.top + totalTitleSize);
if(host._explicitHeight)
{
}
}
};