From 673a3b87bb84ff03cf25758b60901398b4d0d699 Mon Sep 17 00:00:00 2001 From: Robert Konigsberg Date: Sat, 17 Nov 2012 22:21:07 -0500 Subject: [PATCH] Add numAxes function. --- dygraph-options.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) 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; +} -- 2.7.4