merge master
[dygraphs.git] / tests / styled-chart-labels.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9">
5 <title>two series</title>
6 <!--[if IE]>
7 <script type="text/javascript" src="../excanvas.js"></script>
8 <![endif]-->
9 <script type="text/javascript" src="../strftime/strftime-min.js"></script>
10 <script type="text/javascript" src="../rgbcolor/rgbcolor.js"></script>
11 <script type="text/javascript" src="../dygraph-canvas.js"></script>
12 <script type="text/javascript" src="../dygraph.js"></script>
13 <script type="text/javascript" src="data.js"></script>
14 <style type="text/css">
15 #div_g .dygraph-label {
16 /* This applies to the title, x-axis label and y-axis label */
17 font-family: Arial, Helvetica, sans-serif;
18 }
19 #div_g .dygraph-title {
20 /* This rule only applies to the chart title */
21 font-size: 24px;
22 text-shadow: gray 2px 2px 2px; /* color, delta-x, delta-y, blur radius */
23 }
24 #div_g .dygraph-ylabel {
25 /* This rule only applies to the y-axis label */
26 font-size: 18px;
27 text-shadow: gray -2px 2px 2px; /* (offsets are in a rotated frame) */
28 }
29 .chart {
30 border: 1px dashed black;
31 margin: 5px;
32 padding: 2px;
33 }
34 </style>
35 </head>
36 <body>
37 <p>In this chart, each chart label is styled independently. View source to
38 see how it works.</p>
39
40 <div class="chart" id="div_g" style="width:600px; height:300px;"></div>
41
42 <p>This version of the chart uses the default styles:</p>
43 <div class="chart" id="div_g2" style="width:600px; height:300px;"></div>
44
45 <script type="text/javascript">
46 g = new Dygraph(
47 document.getElementById("div_g"),
48 data, {
49 rollPeriod: 7,
50 legend: 'always',
51 title: 'High and Low Temperatures',
52 titleHeight: 32,
53 ylabel: 'Temperature (F)',
54 xlabel: 'Date (Ticks indicate the start of the indicated time period)',
55 labelsDivStyles: {
56 'text-align': 'right',
57 'background': 'none'
58 },
59 strokeWidth: 1.5
60 }
61 );
62
63 g2 = new Dygraph(
64 document.getElementById("div_g2"),
65 data, {
66 rollPeriod: 30,
67 legend: 'always',
68 title: 'High and Low Temperatures (30-day average)',
69 ylabel: 'Temperature (F)',
70 xlabel: 'Date (Ticks indicate the start of the indicated time period)',
71 labelsDivStyles: {
72 'text-align': 'right',
73 'background': 'none'
74 },
75 strokeWidth: 1.5
76 }
77 );
78 </script>
79 </body>
80 </html>