projects
/
dygraphs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Whoops, bad documentation for the new color option.
[dygraphs.git]
/
dygraph-options.js
diff --git
a/dygraph-options.js
b/dygraph-options.js
index
ccba4f8
..
2dc88ae
100644
(file)
--- a/
dygraph-options.js
+++ b/
dygraph-options.js
@@
-36,19
+36,21
@@
var DygraphOptions = (function() {
var DygraphOptions = function(dygraph) {
/**
* The dygraph.
var DygraphOptions = function(dygraph) {
/**
* The dygraph.
- * @type {Dygraph}
+ * @type {
!
Dygraph}
*/
this.dygraph_ = dygraph;
/**
* Array of axis index to { series : [ series names ] , options : { axis-specific options. }
*/
this.dygraph_ = dygraph;
/**
* Array of axis index to { series : [ series names ] , options : { axis-specific options. }
- * @type {Array.<{series : Array.<string>, options : Object}>}
+ * @type {Array.<{series : Array.<string>, options : Object}>}
@private
*/
this.yAxes_ = [];
/**
*/
this.yAxes_ = [];
/**
- * { options : { axis-specific options. }
- * @type {Object}
+ * Contains x-axis specific options, which are stored in the options key.
+ * This matches the yAxes_ object structure (by being a dictionary with an
+ * options element) allowing for shared code.
+ * @type {options: Object} @private
*/
this.xAxis_ = {};
this.series_ = {};
*/
this.xAxis_ = {};
this.series_ = {};
@@
-71,7
+73,7
@@
var DygraphOptions = function(dygraph) {
* Not optimal, but does the trick when you're only using two axes.
* If we move to more axes, this can just become a function.
*
* Not optimal, but does the trick when you're only using two axes.
* If we move to more axes, this can just become a function.
*
- * @type {Object.<
string,
number>}
+ * @type {Object.<number>}
* @private
*/
DygraphOptions.AXIS_STRING_MAPPINGS_ = {
* @private
*/
DygraphOptions.AXIS_STRING_MAPPINGS_ = {
@@
-83,6
+85,10
@@
DygraphOptions.AXIS_STRING_MAPPINGS_ = {
'Y2' : 1
};
'Y2' : 1
};
+/**
+ * @param {string|number} axis
+ * @private
+ */
DygraphOptions.axisToIndex_ = function(axis) {
if (typeof(axis) == "string") {
if (DygraphOptions.AXIS_STRING_MAPPINGS_.hasOwnProperty(axis)) {
DygraphOptions.axisToIndex_ = function(axis) {
if (typeof(axis) == "string") {
if (DygraphOptions.AXIS_STRING_MAPPINGS_.hasOwnProperty(axis)) {
@@
-96,10
+102,6
@@
DygraphOptions.axisToIndex_ = function(axis) {
}
throw "Dygraphs only supports two y-axes, indexed from 0-1.";
}
}
throw "Dygraphs only supports two y-axes, indexed from 0-1.";
}
- if (typeof(axis) == "object") {
- throw "Using objects for axis specification " +
- "is not supported inside the 'series' option.";
- }
if (axis) {
throw "Unknown axis : " + axis;
}
if (axis) {
throw "Unknown axis : " + axis;
}
@@
-181,9
+183,9
@@
DygraphOptions.prototype.reparseSeries = function() {
if (typeof(axis) == 'string') {
if (!this.series_.hasOwnProperty(axis)) {
if (typeof(axis) == 'string') {
if (!this.series_.hasOwnProperty(axis)) {
-
this.dygraph_
.error("Series " + seriesName + " wants to share a y-axis with " +
+
Dygraph
.error("Series " + seriesName + " wants to share a y-axis with " +
"series " + axis + ", which does not define its own axis.");
"series " + axis + ", which does not define its own axis.");
- return
null
;
+ return;
}
var yAxis = this.series_[axis].yAxis;
this.series_[seriesName].yAxis = yAxis;
}
var yAxis = this.series_[axis].yAxis;
this.series_[seriesName].yAxis = yAxis;
@@
-312,7
+314,7
@@
DygraphOptions.prototype.getForAxis = function(name, axis) {
*/
DygraphOptions.prototype.getForSeries = function(name, series) {
// Honors indexes as series.
*/
DygraphOptions.prototype.getForSeries = function(name, series) {
// Honors indexes as series.
- if (series === this.dygraph_.
highlightSet_
) {
+ if (series === this.dygraph_.
getHighlightSeries()
) {
if (this.highlightSeries_.hasOwnProperty(name)) {
return this.highlightSeries_[name];
}
if (this.highlightSeries_.hasOwnProperty(name)) {
return this.highlightSeries_[name];
}
@@
-368,15
+370,6
@@
DygraphOptions.prototype.seriesNames = function() {
return this.labels_;
};
return this.labels_;
};
-/* Are we using this? */
-/**
- * Return the index of the specified series.
- * @param {string} series the series name.
- */
-DygraphOptions.prototype.indexOfSeries = function(series) {
- return this.series_[series].idx;
-};
-
return DygraphOptions;
})();
return DygraphOptions;
})();