63fa8c2aac9e9bf7346691be71f6f6d2eebb79ac
2 * @fileoverview Tests for per-series options.
4 * @author danvk@google.com (Dan Vanderkam)
6 var perSeriesTestCase
= TestCase("per-series");
8 perSeriesTestCase
.prototype.setUp
= function() {
9 document
.body
.innerHTML
= "<div id='graph'></div>";
12 perSeriesTestCase
.prototype.tearDown
= function() {
16 perSeriesTestCase
.prototype.testPerSeriesFill
= function() {
24 Y
: { fillGraph
: true },
25 colors
: [ '#FF0000', '#0000FF' ],
28 var data
= "X,Y,Z\n" +
39 var graph
= document
.getElementById("graph");
40 g
= new Dygraph(graph
, data
, opts
);
42 var sampler
= new PixelSampler(g
);
44 // Inside of the "Z" bump -- no fill.
45 assertEquals([0,0,0,0], sampler
.colorAtCoordinate(2.5, 0.5));
47 // Inside of the "Y" bump -- filled in.
48 assertEquals([255,0,0,38], sampler
.colorAtCoordinate(6.5, 0.5));
51 perSeriesTestCase
.prototype.testOldStyleSeries
= function() {
56 var data
= "X,Y,Z\n1,0,0\n";
57 g
= new Dygraph("Graph", data
, opts
);
59 assertEquals(5, g
.getOption("pointSize"));
60 assertEquals(4, g
.getOption("pointSize", "Y"));
61 assertEquals(5, g
.getOption("pointSize", "Z"));