X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=tests%2Findependent-series.html;h=bddcc6b43ced0447fe054113711ffa5a2a1aa993;hb=e3a1d6944b1474e507e99a5f497d506ae3de2120;hp=6665e73a37fa578b3fcc024fc84b4d8f90a44360;hpb=1ef9d2f7d729769318dafcce4ab0890f72a9ab05;p=dygraphs.git diff --git a/tests/independent-series.html b/tests/independent-series.html index 6665e73..bddcc6b 100644 --- a/tests/independent-series.html +++ b/tests/independent-series.html @@ -101,6 +101,80 @@ ); +

Encoding a gap

+

There's one extra wrinkle. What if one of the series has a missing + value, i.e. what if your series are something like

+ + + + +
+ +
+ + + + + + +
xA
22
44
6(gap)
88
1010
+
+ + + + + +
xB
13
35
57
+
+ +
+

The gap would normally be encoded as a null, or missing value. But when you use connectSeparatedPoints, that has a special meaning. Instead, you have to use NaN. This is a bit of a hack, but it gets the job done.

+ + + + + + +
+ (CSV) +
x,A,B
+1,,3
+2,2,
+3,,5
+4,4,
+5,,7
+6,NaN,
+8,8,
+10,10,
+
+ (native) +
[ [1, null, 3],
+  [2, 2, null],
+  [3, null, 5],
+  [4, 4, null],
+  [5, null, 7],
+  [6, NaN, null],
+  [8, 8, null],
+  [10, 10, null] ]
+
+

Behavior at the edges of the panel for independent series

In case only a part of the whole data is visible (e.g. after zooming in) the lines are drawn to the respective next valid point outside the visible area.

@@ -201,80 +275,6 @@ [8, 4, 2] ] - -

Encoding a gap

-

There's one extra wrinkle. What if one of the series has a missing - value, i.e. what if your series are something like

- - - - -
- -
- - - - - - -
xA
22
44
6(gap)
88
1010
-
- - - - - -
xB
13
35
57
-
- -
-

The gap would normally be encoded as a null, or missing value. But when you use connectSeparatedPoints, that has a special meaning. Instead, you have to use NaN. This is a bit of a hack, but it gets the job done.

- - - - - - -
- (CSV) -
x,A,B
-1,,3
-2,2,
-3,,5
-4,4,
-5,,7
-6,NaN,
-8,8,
-10,10,
-
- (native) -
[ [1, null, 3],
-  [2, 2, null],
-  [3, null, 5],
-  [4, 4, null],
-  [5, null, 7],
-  [6, NaN, null],
-  [8, 8, null],
-  [10, 10, null] ]
-