| 1 |
<!doctype html> |
| 2 |
|
| 3 |
<link type="text/css" rel="stylesheet" href="../src/css/graph.css"> |
| 4 |
<link type="text/css" rel="stylesheet" href="css/lines.css"> |
| 5 |
<link type="text/css" rel="stylesheet" href="../rickshaw.css"> |
| 6 |
|
| 7 |
<script src="../vendor/d3.v3.js"></script> |
| 8 |
|
| 9 |
<script src="../rickshaw.js"></script> |
| 10 |
|
| 11 |
<div id="chart"></div> |
| 12 |
|
| 13 |
<script> |
| 14 |
|
| 15 |
var palette = new Rickshaw.Color.Palette(); |
| 16 |
|
| 17 |
var graph = new Rickshaw.Graph( { |
| 18 |
element: document.getElementById("chart"), |
| 19 |
renderer: 'area', |
| 20 |
stroke: true, |
| 21 |
series: [ |
| 22 |
{ |
| 23 |
data: [ { x: 0, y: 19 }, { x: 1, y: 30 }, { x: 2, y: 22 }, { x: 3, y: 29 }, { x: 4, y: 21 }, { x: 5, y: 29 } ], |
| 24 |
name: 'new york', |
| 25 |
color: palette.color() |
| 26 |
}, { |
| 27 |
data: [ { x: 0, y: 19 }, { x: 1, y: 29 }, { x: 2, y: 22 }, { x: 3, y: 27 }, { x: 4, y: 21 }, { x: 5, y: 29 } ], |
| 28 |
name: 'boston', |
| 29 |
color: palette.color() |
| 30 |
}, { |
| 31 |
data: [ { x: 0, y: 19 }, { x: 1, y: 22 }, { x: 2, y: 10 }, { x: 3, y: null }, { x: 4, y: 21 }, { x: 5, y: 29 } ], |
| 32 |
name: 'los angeles', |
| 33 |
color: palette.color() |
| 34 |
}, { |
| 35 |
data: [ { x: 0, y: 19 }, { x: 1, y: 10 }, { x: 2, y: 22 }, { x: 3, y: null }, { x: 4, y: 21 }, { x: 5, y: 29 } ], |
| 36 |
name: 'san francisco', |
| 37 |
color: palette.color() |
| 38 |
} |
| 39 |
] |
| 40 |
} ); |
| 41 |
|
| 42 |
graph.render(); |
| 43 |
|
| 44 |
new Rickshaw.Graph.HoverDetail({ graph: graph }); |
| 45 |
|
| 46 |
</script> |