add custom styling for labels
[dygraphs.git] / tests / customLabel.html
diff --git a/tests/customLabel.html b/tests/customLabel.html
new file mode 100644 (file)
index 0000000..c6a1c92
--- /dev/null
@@ -0,0 +1,36 @@
+<html>
+  <head>
+    <title>Label styles</title>
+    <!--[if IE]>
+    <script type="text/javascript" src="excanvas.js"></script>
+    <![endif]-->
+    <script type="text/javascript" src="../dygraph-combined.js"></script>
+    <script type="text/javascript" src="../dygraph.js"></script>
+    <script type="text/javascript" src="data.js"></script>
+  </head>
+  <body>
+    <p>Labels are transparent and repositioned:</p>
+    <div id="g14" style="width:600px; height:300px;"></div>
+
+    <script type="text/javascript">
+      g14 = new DateGraph(
+            document.getElementById("g14"),
+            NoisyData, null, {
+              rollPeriod: 14,
+              errorBars: true,
+              labelsDivWidth: 160,
+              labelsDivStyles: {
+                'background-color': 'transparent',
+                'top': '10px'
+              },
+              padding: {
+                left: 40,
+                top: 0,
+                right: 10,
+                bottom: 10
+              }
+            }
+          );
+    </script>
+  </body>
+</html>