From 29b9b77814dc7e5d8b57d50fff6d3d8a10e42862 Mon Sep 17 00:00:00 2001 From: Robert Konigsberg Date: Sun, 15 Sep 2013 11:10:59 -0400 Subject: [PATCH] Add test that verifies wilsonInterval is respected per-series. --- auto_tests/tests/rolling_average.js | 49 +++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/auto_tests/tests/rolling_average.js b/auto_tests/tests/rolling_average.js index 1287aa1..d9675d1 100644 --- a/auto_tests/tests/rolling_average.js +++ b/auto_tests/tests/rolling_average.js @@ -230,6 +230,55 @@ rollingAverageTestCase.prototype.testRollFractionsBarsWilson = function() { } }; + +rollingAverageTestCase.prototype.testWilsonIntervalPerSeries = function() { + var opts = { + fractions: true, + errorBars: true, + rollPeriod: 2, + labels: ['x', 'A'], + + series: { + A: { wilsonInterval : true }, + } + }; + var data = [ [1, [1, 10]], + [2, [2, 10]], + [3, [3, 10]], + [4, [4, 10]] + ]; + + var graph = document.getElementById("graph"); + var g = new Dygraph(graph, data, opts); + var rolled = this.getRolledData(g, data, 1, 2); + + //precalculated rounded values expected + var values = [10, 15, 25, 35]; + var lows = [2, 5, 11, 18]; + var highs = [41, 37, 47, 57]; + + for (var i=0;i