X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=tests%2Findependent-series.html;h=6665e73a37fa578b3fcc024fc84b4d8f90a44360;hb=3fb516b5e8b861f15754428c6071688ab121bb6c;hp=7e589769e5dc8a086bd1e57f37e7a8ac65fcb3a4;hpb=f6fbf9e09f24167a8e28e39a5fc2d6a1b5184bfa;p=dygraphs.git diff --git a/tests/independent-series.html b/tests/independent-series.html index 7e58976..6665e73 100644 --- a/tests/independent-series.html +++ b/tests/independent-series.html @@ -101,6 +101,107 @@ ); +

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.

+ + + + +
+ +
+ + + + + + + + + +
xA
02
13
23
44
53
63
73
84
+
+ + + + + + +
xB
01
12
21
82
+
+ +
+

Both graphs have no value at the right edge of the panel (x=3). The lines that are drawn to the right edge are determined by their respective next valid value outside the visible area. + Therefore it is neither necessary that the next valid values are on the same point nor that they have the same index (index 4 for the green line and index 8 for the blue line).

+

Use double click to unzoom and see the currently invisible points

+ + + + + + + +
+ Index +
 
+0
+1
+2
+3
+4
+5
+6
+7
+8
+
+ (CSV) +
x,A,B
+0,2,1
+1,3,2
+2,3,1
+3,,
+4,4,
+5,3,
+6,3,
+7,3,
+8,4,2
+
+ (native) +
[ 
+  [0, 2, 1], 
+  [1, 3, 2],
+  [2, 3, 1],
+  [3, null, null],
+  [4, 4, null],
+  [5, 3, null],
+  [6, 3, null],
+  [7, 3, null],
+  [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

@@ -127,12 +228,12 @@ -
+

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.