File: fillGraph-alpha.html

package info (click to toggle)
dygraphs 2.2.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,340 kB
  • sloc: javascript: 24,842; sh: 800; python: 581; makefile: 45
file content (76 lines) | stat: -rw-r--r-- 1,981 bytes parent folder | download | duplicates (2)
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>fillGraph with per series fillAlpha</title>

    <link rel="stylesheet" type="text/css" href="../dist/dygraph.css" />
    <link rel="stylesheet" type="text/css" href="../common/vextlnk.css" />
    <script type="text/javascript" src="../dist/dygraph.js"></script>
  </head>
  <body>
    <p>Filled, using default value</p>
    <div id="div_g0" style="width:600px; height:300px;"></div>

    <p>Filled, using global alpha value</p>
    <div id="div_g1" style="width:600px; height:300px;"></div>

    <p>Filled, using per series alpha values</p>
    <div id="div_g2" style="width:600px; height:300px;"></div>

    <p>Filled, using a mix of global and per series values</p>
    <div id="div_g3" style="width:600px; height:300px;"></div>

    <script type="text/javascript"><!--//--><![CDATA[//><!--
    Dygraph.onDOMready(function onDOMready() {
      // Create some data for the charts
      var gdata = "X,Y1,Y2\n";
      for (var i = 0; i < 100; i++) {
        gdata += i + "," + i + "," + (i * (100-i) * 100/(50*50)) + "\n";
      }

      // Just use the default values
      var g0 = new Dygraph(
        document.getElementById("div_g0"),
        gdata,
        {
          fillGraph: true
        }
      );

      var g1 = new Dygraph(
        document.getElementById("div_g1"),
        gdata,
        {
          fillGraph: true,
          fillAlpha: 0.8
        }
      );

      var g2 = new Dygraph(
        document.getElementById("div_g2"),
        gdata,
        {
          fillGraph: true,
          series: {
            Y1: { fillAlpha: 0.9 },
            Y2: { fillAlpha: 0.1 }
          }
        }
      );

      var g3 = new Dygraph(
        document.getElementById("div_g3"),
        gdata,
        {
          fillGraph: true,
          fillAlpha: 0.9,
          series: {
            Y2: { fillAlpha: 0.1 }
          }
        }
      );
    });
    //--><!]]></script>
  </body>
</html>