Merge pull request #469 from danvk/re-smooth-plotter
[dygraphs.git] / auto_tests / tests / per_series.js
index 8d81c7b..7289e0c 100644 (file)
@@ -146,3 +146,31 @@ perSeriesTestCase.prototype.testAxisInNewSeries_withAxes = function() {
   assertEquals(6, g.getOption("pointSize", "D"));
   assertEquals(7, g.getOption("pointSize", "E"));
 };
+
+// TODO(konigsberg): move to multiple_axes.js
+perSeriesTestCase.prototype.testOldAxisSpecInNewSeriesThrows = function() {
+  var opts = {
+    series : {
+      D : { axis : {} },
+    },
+  };
+  var graph = document.getElementById("graph");
+  var data = "X,A,B,C,D,E\n0,1,2,3,4,5\n";
+  var threw = false;
+  try {
+    new Dygraph(graph, data, opts);
+  } catch(e) {
+    threw = true;
+  }
+
+  assertTrue(threw);
+}
+
+perSeriesTestCase.prototype.testColorOption = function() {
+  var graph = document.getElementById("graph");
+  var data = "X,A,B,C\n0,1,2,3\n";
+  var g = new Dygraph(graph, data, {});
+  assertEquals(['rgb(64,128,0)', 'rgb(64,0,128)', 'rgb(0,128,128)'], g.getColors());
+  g.updateOptions({series : { B : { color : 'purple' }}});
+  assertEquals(['rgb(64,128,0)', 'purple', 'rgb(0,128,128)'], g.getColors());
+}