X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dygraph.js;h=8e06ba2e1f08fa5f96dc0064da636e03f284dac8;hb=4c10c8d21b6858ea9029bdb789f487d9103d72f9;hp=eba57db5d528039ac6498f3d1c5c193c9f280ba8;hpb=45b74fb1d2acd535102445a8a9301d7a6a39192d;p=dygraphs.git diff --git a/dygraph.js b/dygraph.js index eba57db..8e06ba2 100644 --- a/dygraph.js +++ b/dygraph.js @@ -3500,9 +3500,12 @@ Dygraph.prototype.annotations = function() { /** * Get the list of label names for this graph. The first column is the * x-axis, so the data series names start at index 1. + * + * Returns null when labels have not yet been defined. */ Dygraph.prototype.getLabels = function() { - return this.attr_("labels").slice(); + var labels = this.attr_("labels"); + return labels ? labels.slice() : null; }; /**