File: styled-chart-labels.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 (80 lines) | stat: -rw-r--r-- 2,565 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
77
78
79
80
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>two series</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>
    <script type="text/javascript" src="data.js"></script>

    <style type="text/css">
    #div_g .dygraph-label {
      /* This applies to the title, x-axis label and y-axis label */
      font-family: Arial, Helvetica, sans-serif;
    }
    #div_g .dygraph-title {
      /* This rule only applies to the chart title */
      font-size: 24px;
      text-shadow: gray 2px 2px 2px;  /* color, delta-x, delta-y, blur radius */
    }
    #div_g .dygraph-ylabel {
      /* This rule only applies to the y-axis label */
      font-size: 18px;
      text-shadow: gray -2px 2px 2px;  /* (offsets are in a rotated frame) */
    }
    .chart {
      border: 1px dashed black;
      margin: 5px;
      padding: 2px;
    }
    .actuallychart {
      width: 100%;
      height: 100%;
    }
    .dygraph-legend {
      text-align: right;
      background: none;
    }
    </style>
  </head>
  <body>
    <p>In this chart, each chart label is styled independently. View source to
    see how it works.</p>

    <div class="chart" style="width:600px; height:300px;"><div class="actuallychart" id="div_g"></div></div>

    <p>This version of the chart uses the default styles:</p>
    <div class="chart" style="width:600px; height:300px;"><div class="actuallychart" id="div_g2"></div></div>

    <script type="text/javascript"><!--//--><![CDATA[//><!--
    Dygraph.onDOMready(function onDOMready() {
      g = new Dygraph(
            document.getElementById("div_g"),
            data, {
              rollPeriod: 7,
              legend: 'always',
              title: 'High and Low Temperatures',
              titleHeight: 32,
              ylabel: 'Temperature (F)',
              xlabel: 'Date (Ticks indicate the start of the indicated time period)',
              strokeWidth: 1.5
            }
          );

      g2 = new Dygraph(
            document.getElementById("div_g2"),
            data, {
              rollPeriod: 30,
              legend: 'always',
              title: 'High and Low Temperatures (30-day average)',
              ylabel: 'Temperature (F)',
              xlabel: 'Date (Ticks indicate the start of the indicated time period)',
              strokeWidth: 1.5
            }
          );
    });
    //--><!]]></script>
  </body>
</html>