From: Robert Konigsberg Date: Sun, 18 Nov 2012 03:21:07 +0000 (-0500) Subject: Add numAxes function. X-Git-Tag: v1.0.0~157^2~3^2~4 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=673a3b87bb84ff03cf25758b60901398b4d0d699;p=dygraphs.git Add numAxes function. --- diff --git a/dygraph-options.js b/dygraph-options.js index cc8c770..c15c684 100644 --- a/dygraph-options.js +++ b/dygraph-options.js @@ -9,11 +9,11 @@ /* * Interesting member variables: * dygraph_ - the graph. - * global - global attributes (common among all graphs, AIUI) - * user - attributes set by the user - * axes - * series - { seriesName -> { idx, yAxis, options } - * labels - used as mapping from index to series name. + * global_ - global attributes (common among all graphs, AIUI) + * user_ - attributes set by the user + * axes_ - array of axis index to axis-specific options. + * series_ - { seriesName -> { idx, yAxis, options } + * labels_ - used as mapping from index to series name. */ /** @@ -141,3 +141,10 @@ DygraphOptions.prototype.findForSeries = function(name, series) { return this.findForAxis(name, seriesObj["yAxis"]); } +/** + * Returns the number of y-axes on the chart. + * @return {Number} the number of axes. + */ +DygraphOptions.prototype.numAxes = function() { + return this.axes_.length; +}