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