f69d245bb21be88752420e834a6b6be37e9b525fTripp * Gridlines draws gridlines on a Graph.
a75ebc38c1de401b679953a9b87bd323f0f48d02Tripp * @module charts
8648721e29bb657dd5c5ff20f03e86fe50628ce6Tripp * @class Gridlines
8648721e29bb657dd5c5ff20f03e86fe50628ce6Tripp * @constructor
8648721e29bb657dd5c5ff20f03e86fe50628ce6Tripp * @extends Base
8648721e29bb657dd5c5ff20f03e86fe50628ce6Tripp * @uses Renderer
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTrippY.Gridlines = Y.Base.create("gridlines", Y.Base, [Y.Renderer], {
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * Reference to the `Path` element used for drawing Gridlines.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @property _path
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @type Path
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * Removes the Gridlines.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @method remove
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp remove: function()
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp * Draws the gridlines
f69d245bb21be88752420e834a6b6be37e9b525fTripp * @method draw
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @protected
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp draw: function()
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * Algorithm for drawing gridlines
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @method _drawGridlines
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp lineFunction = direction == "vertical" ? this._verticalLine : this._horizontalLine;
d79066bfa31eec6909a20ccabb5227cc1e1ea2d0Tripp if(axisPosition != "none" && axis && axis.get("tickPoints"))
d79066bfa31eec6909a20ccabb5227cc1e1ea2d0Tripp for(; i < l; ++i)
d79066bfa31eec6909a20ccabb5227cc1e1ea2d0Tripp x: w * (i/(l-1)),
d79066bfa31eec6909a20ccabb5227cc1e1ea2d0Tripp y: h * (i/(l-1))
e393eced613f9b4a5fb6bdd461d0e0bf5064d5ecTripp for(; i < l; ++i)
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * Algorithm for horizontal lines.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @method _horizontalLine
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @param {Path} path Reference to path element
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @param {Object} pt Coordinates corresponding to a major unit of an axis.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @param {Number} w Width of the Graph
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @param {Number} h Height of the Graph
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * Algorithm for vertical lines.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @method _verticalLine
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @param {Path} path Reference to path element
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @param {Object} pt Coordinates corresponding to a major unit of an axis.
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @param {Number} w Width of the Graph
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @param {Number} h Height of the Graph
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * Gets the default value for the `styles` attribute. Overrides
8648721e29bb657dd5c5ff20f03e86fe50628ce6Tripp * base implementation.
8648721e29bb657dd5c5ff20f03e86fe50628ce6Tripp * @method _getDefaultStyles
8648721e29bb657dd5c5ff20f03e86fe50628ce6Tripp * @return Object
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * @protected
f69d245bb21be88752420e834a6b6be37e9b525fTripp * Indicates the direction of the gridline.
f69d245bb21be88752420e834a6b6be37e9b525fTripp * @attribute direction
f69d245bb21be88752420e834a6b6be37e9b525fTripp * @type String
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * Indicate the `Axis` in which to bind
f69d245bb21be88752420e834a6b6be37e9b525fTripp * the gridlines.
f69d245bb21be88752420e834a6b6be37e9b525fTripp * @attribute axis
f69d245bb21be88752420e834a6b6be37e9b525fTripp * @type Axis
8209f3939e32e0e5bde64192267fdaf9db6f4fbcTripp * Indicates the `Graph` in which the gridlines
f69d245bb21be88752420e834a6b6be37e9b525fTripp * are drawn.
f69d245bb21be88752420e834a6b6be37e9b525fTripp * @attribute graph
f69d245bb21be88752420e834a6b6be37e9b525fTripp * @type Graph