Remove legacy options:
[dygraphs.git] / auto_tests / tests / per_series.js
index ab52add..d451b64 100644 (file)
@@ -16,11 +16,19 @@ perSeriesTestCase.prototype.testPerSeriesFill = function() {
   var opts = {
     width: 480,
     height: 320,
-    drawXGrid: false,
-    drawYGrid: false,
-    drawXAxis: false,
-    drawYAxis: false,
-    Y: { fillGraph: true },
+    axes : {
+      x : {
+        drawGrid: false,
+        drawAxis: false,
+      },
+      y : {
+        drawGrid: false,
+        drawAxis: false,
+      }
+    },
+    series: {
+      Y: { fillGraph: true },
+    },
     colors: [ '#FF0000', '#0000FF' ],
     fillAlpha: 0.15
   };
@@ -156,11 +164,21 @@ perSeriesTestCase.prototype.testOldAxisSpecInNewSeriesThrows = function() {
   };
   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) {
-    assertEquals(
-        "Using objects for axis specification is not supported inside the 'series' option.",
-        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());
 }