From a8f4eb627e7f380b85e4be2426c46e1d45170b23 Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Fri, 16 Dec 2011 17:45:18 -0500 Subject: [PATCH] Fix issue 247 and flesh out its regression test. --- auto_tests/tests/update_options.js | 11 +++++++++-- dygraph-utils.js | 3 --- 2 files changed, 9 insertions(+), 5 deletions(-) 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, -- 2.7.4