idea ide updates
[scannr.git] / js / flotr2 / spec / js / test-mountain-nulls.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
(function () {
 
    Flotr.ExampleList.add({
        key: 'test-mountain-nulls',
        name: 'Mountain Nulls',
        callback: function (container) {
            var
                d1 = [
                    [0, 3],
                    [4, 8],
                    [5, 6],
                    [6, null],
                    [7, 7],
                    [8, 5]
                ], // First data series
                d2 = [],                                // Second data series
                i, graph;
 
            // Generate first data set
            for (i = 0; i < 14; i += 0.5) {
                d2.push([i, Math.sin(i)]);
            }
 
            // Multiple nulls
            d2[9][1] = null;
            d2[10][1] = null;
            d2[11][1] = null;
 
            // Single not null surrounded by null
            d2[13][1] = null;
 
            // < 0 null
            d2[23][1] = null;
 
            // Draw Graph
            graph = Flotr.draw(container, [ d1, d2 ], {
                xaxis: {
                    minorTickFreq: 4
                },
                lines: {
                    fill: true
                },
                grid: {
                    minorVerticalLines: true
                }
            });
        },
        type: 'test'
    });
 
})();