diff --git a/src/js/Rickshaw.Graph.Axis.Y.js b/src/js/Rickshaw.Graph.Axis.Y.js index c34e7876..ef37d144 100644 --- a/src/js/Rickshaw.Graph.Axis.Y.js +++ b/src/js/Rickshaw.Graph.Axis.Y.js @@ -3,7 +3,8 @@ Rickshaw.namespace('Rickshaw.Graph.Axis.Y'); Rickshaw.Graph.Axis.Y = Rickshaw.Class.create( { initialize: function(args) { - + + this.args = args; this.graph = args.graph; this.orientation = args.orientation || 'right'; @@ -101,6 +102,21 @@ Rickshaw.Graph.Axis.Y = Rickshaw.Class.create( { .attr("transform", transform) .call(axis.ticks(this.ticks).tickSubdivide(0).tickSize(this.tickSize)); + // add label + if (this.args.label && this.args.label.text) { + var label = this.args.label; + this.vis.append("text") + .attr("class", "axis-label") + .attr("text-anchor", "end") + .attr("y", label.offsetX || "1em") + .attr("x", label.offsetY || "1em") + .style("color", label.color || "black") + .style("opacity", label.opacity || "0.5") + .style("font-size", label.fontSize || "10px") + .attr("transform", "rotate(-90)") + .text(label.text); + } + return axis; },