From: Robert Konigsberg Date: Sun, 15 Sep 2013 15:10:59 +0000 (-0400) Subject: Add test that verifies wilsonInterval is respected per-series. X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=refs%2Fheads%2Fexpanddata;p=dygraphs.git Add test that verifies wilsonInterval is respected per-series. --- 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