From 30abcfb6d82bb759400f4fad15a691ffad77d049 Mon Sep 17 00:00:00 2001 From: Robert Konigsberg Date: Thu, 22 Nov 2012 12:02:24 -0500 Subject: [PATCH] Add tests for new series option. --- auto_tests/tests/per_series.js | 17 +++++++++++-- tests/custom-circles.html | 16 ++++++------ tests/isolated-points.html | 6 +++-- tests/per-series.html | 55 +++++++++++++++++++++++++++++++++--------- tests/two-axes-vr.html | 36 +++++++++++++++------------ 5 files changed, 92 insertions(+), 38 deletions(-) diff --git a/auto_tests/tests/per_series.js b/auto_tests/tests/per_series.js index 4831ded..8f647cc 100644 --- a/auto_tests/tests/per_series.js +++ b/auto_tests/tests/per_series.js @@ -1,9 +1,9 @@ /** - * @fileoverview FILL THIS IN + * @fileoverview Tests for per-series options. * * @author danvk@google.com (Dan Vanderkam) */ -var perSeriesTestCase = TestCase("per-series"); +var Tests for per-series options. perSeriesTestCase.prototype.setUp = function() { document.body.innerHTML = "
"; @@ -48,3 +48,16 @@ perSeriesTestCase.prototype.testPerSeriesFill = function() { assertEquals([255,0,0,38], sampler.colorAtCoordinate(6.5, 0.5)); }; +perSeriesTestCase.prototype.testOldStyleSeries = function() { + var opts = { + pointSize : 5 + Y: { pointSize : 4 }, + }; + var data = "X,Y,Z\n1,0,0\n"; + g = new Dygraph("Graph", data, opts); + + assertEquals(5, g.getOption("pointSize")); + assertEquals(4, g.getOption("pointSize", "Y")); + assertEquals(5, g.getOption("pointSize", "Z")); +}; + diff --git a/tests/custom-circles.html b/tests/custom-circles.html index f2ef094..0e6d62f 100644 --- a/tests/custom-circles.html +++ b/tests/custom-circles.html @@ -31,13 +31,15 @@ drawPoints : true, pointSize : 5, highlightCircleSize: 8, - A : { - drawPointCallback : Dygraph.Circles.TRIANGLE, - drawHighlightPointCallback : Dygraph.Circles.TRIANGLE - }, - B : { - drawPointCallback : Dygraph.Circles.HEXAGON, - drawHighlightPointCallback : Dygraph.Circles.HEXAGON + series : { + A : { + drawPointCallback : Dygraph.Circles.TRIANGLE, + drawHighlightPointCallback : Dygraph.Circles.TRIANGLE + }, + B : { + drawPointCallback : Dygraph.Circles.HEXAGON, + drawHighlightPointCallback : Dygraph.Circles.HEXAGON + } } }); diff --git a/tests/isolated-points.html b/tests/isolated-points.html index f507fda..1c1da06 100644 --- a/tests/isolated-points.html +++ b/tests/isolated-points.html @@ -29,8 +29,10 @@ ], { labels: ["X", "S1", "S2" ], - S1: { - drawGapEdgePoints: true + series: { + S1: { + drawGapEdgePoints: true + } }, pointSize: 4, showRoller: true diff --git a/tests/per-series.html b/tests/per-series.html index 98501ac..84730b1 100644 --- a/tests/per-series.html +++ b/tests/per-series.html @@ -18,6 +18,8 @@

Chart with per-series properties with legend.

+

First graph, using old-style series specification.

+