add back Dygraph.floatFormat
[dygraphs.git] / tests / styled-chart-labels.html
CommitLineData
ca49434a
DV
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">
3bc2cb3c 15 #div_g .dygraph-label {
ca49434a
DV
16 /* This applies to the title, x-axis label and y-axis label */
17 font-family: Arial, Helvetica, sans-serif;
18 }
3bc2cb3c 19 #div_g .dygraph-title {
ca49434a
DV
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 }
3bc2cb3c 24 #div_g .dygraph-ylabel {
ca49434a
DV
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 }
b4202b3d
DV
29 .chart {
30 border: 1px dashed black;
31 margin: 5px;
32 padding: 2px;
33 }
ca49434a
DV
34 </style>
35 </head>
36 <body>
3bc2cb3c
DV
37 <p>In this chart, each chart label is styled independently. View source to
38 see how it works.</p>
39
b4202b3d 40 <div class="chart" id="div_g" style="width:600px; height:300px;"></div>
ca49434a 41
3bc2cb3c 42 <p>This version of the chart uses the default styles:</p>
b4202b3d 43 <div class="chart" id="div_g2" style="width:600px; height:300px;"></div>
ca49434a
DV
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)',
b4202b3d 54 xlabel: 'Date (Ticks indicate the start of the indicated time period)',
ca49434a
DV
55 labelsDivStyles: {
56 'text-align': 'right',
57 'background': 'none'
58 },
59 strokeWidth: 1.5
60 }
61 );
3bc2cb3c
DV
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)',
b4202b3d 70 xlabel: 'Date (Ticks indicate the start of the indicated time period)',
3bc2cb3c
DV
71 labelsDivStyles: {
72 'text-align': 'right',
73 'background': 'none'
74 },
75 strokeWidth: 1.5
76 }
77 );
ca49434a
DV
78 </script>
79 </body>
80</html>