RightAxisLayout.js revision a5057260e5538ddf2faca20fa81271eeff2bf892
/**
* RightAxisLayout contains algorithms for rendering a right axis.
*
* @constructor
* @class RightAxisLayout
*/
RightAxisLayout = function(){};
/**
* Default margins for text fields.
*
* @private
* @method _getDefaultMargins
* @return Object
*/
_getDefaultMargins: function()
{
return {
top: 0,
left: 4,
right: 0,
bottom: 0
};
},
/**
* Sets the length of the tick on either side of the axis line.
*
* @method setTickOffset
* @protected
*/
setTickOffsets: function()
{
var host = this,
switch(display)
{
case "inside" :
break;
case "outside" :
break;
case "cross" :
break;
default:
break;
}
},
/**
* Draws a tick
*
* @method drawTick
* @param {Object} pt Point on the axis in which the tick will intersect.
* @param {Object) tickStyle Hash of properties to apply to the tick.
* @protected
*/
{
var host = this,
},
/**
* Calculates the coordinates for the first point on an axis.
*
* @method getLineStart
* @return {Object}
* @protected
*/
getLineStart: function()
{
var host = this,
if(display === "inside")
{
pt.x += tickLength;
}
else if(display === "cross")
{
}
return pt;
},
/**
* Calculates the point for a label.
*
* @method getLabelPoint
* @param {Object} point Point on the axis in which the tick will intersect.
* @return {Object}
* @protected
*/
getLabelPoint: function(point)
{
},
/**
* Updates the value for the <code>maxLabelSize</code> for use in calculating total size.
*
* @method updateMaxLabelSize
* @param {HTMLElement} label to measure
* @protected
*/
updateMaxLabelSize: function(label)
{
var host = this,
props = this._labelRotationProps,
max;
if(!DOCUMENT.createElementNS)
{
label.style.filter = 'progid:DXImageTransform.Microsoft.Matrix(M11=' + m11 + ' M12=' + m12 + ' M21=' + m21 + ' M22=' + m22 + ' sizingMethod="auto expand")';
}
else
{
if(rot === 0)
{
}
else if(absRot === 90)
{
}
else
{
}
}
},
/**
* Rotate and position title.
*
* @method positionTitle
* @param {HTMLElement} label to rotate position
* @protected
*/
positionTitle: function(label)
{
var host = this,
max,
x = 0,
leftOffset = this.get("maxLabelSize") + margin.left + this.get("rightTickOffset") + this.get("styles").label.margin.left,
topOffset = 0,
{
if(rot === 0)
{
max = labelWidth;
}
else if(absRot === 90)
{
max = labelHeight;
if(rot === 90)
{
}
else
{
}
}
else
{
if(rot > 0)
{
}
else
{
}
}
}
else
{
if(rot === 0)
{
max = labelWidth;
}
else if(rot === 90)
{
max = labelHeight;
}
else if(rot === -90)
{
max = labelHeight;
}
else
{
}
}
y += topOffset;
x += leftOffset;
this._titleSize = max;
},
/**
* 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,
leftOffset = pt.x,
props = this._labelRotationProps,
{
}
if(!DOCUMENT.createElementNS)
{
if(rot === 0)
{
}
else if(absRot === 90)
{
}
else if(rot > 0)
{
}
else
{
}
leftOffset += margin;
leftOffset += tickOffset;
return;
}
if(rot === 0)
{
}
else if(rot === 90)
{
}
else if(rot === -90)
{
}
else if(rot < 0)
{
}
else
{
}
leftOffset += margin;
leftOffset += tickOffset;
},
/**
* Calculates the size and positions the content elements.
*
* @method setSizeAndPosition
* @protected
*/
setSizeAndPosition: function()
{
var host = this,
{
}
sz += this._titleSize;
},
/**
* 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("rightTickOffset") + host.get("maxLabelSize") + this._titleSize + host.get("styles").title.margin.left + style.margin.left);
}
};