From: Dan Vanderkam Date: Fri, 16 Dec 2011 22:45:18 +0000 (-0500) Subject: Fix issue 247 and flesh out its regression test. X-Git-Tag: v1.0.0~408 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=a8f4eb627e7f380b85e4be2426c46e1d45170b23;p=dygraphs.git Fix issue 247 and flesh out its regression test. --- diff --git a/auto_tests/tests/update_options.js b/auto_tests/tests/update_options.js index b40d705..28cc840 100644 --- a/auto_tests/tests/update_options.js +++ b/auto_tests/tests/update_options.js @@ -136,11 +136,18 @@ UpdateOptionsTestCase.prototype.testUpdateColors = function() { graph.updateOptions({ colors: colors1 }); assertEquals(colors1, graph.getColors()); + // extra colors are ignored until you add additional data series. var colors2 = [ "#aaa", "#bbb", "#ccc" ]; graph.updateOptions({ colors: colors2 }); - assertEquals(colors2, graph.getColors()); + assertEquals(colors1, graph.getColors()); + graph.updateOptions({ file: + "X,Y1,Y2,Y3\n" + + "2011-01-01,2,3,4\n" + + "2011-02-02,5,3,2\n" + }); + assertEquals(colors2, graph.getColors()); - graph.updateOptions({ colors: null }); + graph.updateOptions({ colors: null, file: this.data }); assertEquals(defaultColors, graph.getColors()); } diff --git a/dygraph-utils.js b/dygraph-utils.js index db04314..be1c7fb 100644 --- a/dygraph-utils.js +++ b/dygraph-utils.js @@ -642,9 +642,6 @@ Dygraph.isPixelChangingOptionList = function(labels, attrs) { 'axisLineColor': true, 'axisLineWidth': true, 'clickCallback': true, - 'colorSaturation': true, - 'colorValue': true, - 'colors': true, 'digitsAfterDecimal': true, 'drawCallback': true, 'drawPoints': true,