forked from batu-bacan/sheetsee.js
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdemo-chart.html
93 lines (87 loc) · 4.16 KB
/
demo-chart.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title>Sheetsee Chart Demo</title>
<meta name='viewport' content='width=device-width, initial-scale=1.0'/>
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js'></script>
<link rel="shortcut icon" href="../favicon.png">
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700,900,400italic|Source+Code+Pro:400' rel='stylesheet' type='text/css'>
<script type='text/javascript' src='../js/tabletop1.3.4.js'></script>
<script type='text/javascript' src='../js/sheetsee.js'></script>
<link rel='stylesheet' type='text/css' href='../assets/style.css'>
</head>
<style>
#pennies.axis {shape-rendering: crispEdges;}
#pennies.x.axis .minor, #pennies.y.axis .minor {stroke-opacity: .5;}
#pennies.x.axis {stroke-opacity: 1;}
#pennies.y.axis line, #pennies.y.axis path, #pennies.x.axis path {fill: none; stroke: #acacac; stroke-width: 1;}
#pennies .x.axis line {stroke: #acacac; stroke-opacity: .75;}
.bigg {-webkit-transition: all .2s ease-in-out; -webkit-transform: scale(2);}
path.chartLine {stroke: #14ECC8; stroke-width: 3; fill: none;}
#pennies div.tooltip {position: absolute; text-align: left; padding: 4px 8px; width: auto; font-size: 10px; height: auto; background: #fff; border: 0px; pointer-events: none; font-family: Helvetica, Arial, sans-serif;}
circle {fill: #fff; cursor: pointer;}
path.domain {fill: #CCF4FF;}
</style>
<body>
<div class="container">
<h1>Pennies by State</h1>
<p><em><a href="https://docs.google.com/a/github.com/spreadsheet/ccc?key=0Ao5u1U6KYND7dGN5QngweVJUWE16bTRob0d2a3dCbnc&usp=drive_web#gid=0" target="_blank">spreadsheet</a></em></p>
<div id="pennies"></div>
<p><em><a onClick='window.location="view-source:" + window.location.href'>View Source</a> // <a href="../docs/sheetsee-charts.html">View Documentation</a></em></p>
<footer>
<h4 id="getting-started">Getting Started</h4>
<ul>
<li><a href="../docs/about.html">About Sheetsee</a></li>
<li><a href="../docs/building.html">Building Sheetsee</a></li>
<li><a href="../docs/basics.html">Basics</a></li>
</ul>
<h4 id="ideas">Ideas</h4>
<ul>
<li><a href="../docs/fork-n-go.html">Fork-n-Go</a></li>
<li><a href="../docs/tips.html">Tips!</a></li>
<li><a href="../docs/custom-charts.html">Custom charts</a></li>
</ul>
<h4>Demos</h4>
<ul>
<li><a href="./demo-table.html">Table Demo</a></li>
<li><a href="./demo-map.html">Map Demo</a></li>
<li><a href="./demo-chart.html">Chart Demo</a></li>
</ul>
<h4 id="use">Use</h4>
<ul>
<li><a href="../docs/sheetsee-core.html">Sheetsee-core</a></li>
<li><a href="../docs/sheetsee-tables.html">Sheetsee-tables</a></li>
<li><a href="../docs/sheetsee-maps.html">Sheetsee-maps</a></li>
<li><a href="../docs/sheetsee-charts.html">Sheetsee-charts</a></li>
</ul>
<h4 id="use">Contact</h4>
<ul>
<li><a href="http://www.twitter.com/jllord">@jllord</a></li>
<li><a href="https://github.com/jlord/sheetsee.js/issues/new">File an issue</a></li>
</ul>
<h4><a class="home-link" href="http://jlord.github.io/sheetsee.js">Home Page</a></h4>
</footer>
</div>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
var URL = "0Ao5u1U6KYND7dGN5QngweVJUWE16bTRob0d2a3dCbnc"
Tabletop.init( { key: URL, callback: showInfo, simpleSheet: true } )
})
function showInfo(data) {
var cali = Sheetsee.getOccurance(data, "state")
var colors = ['#ff00ff', '#acacac']
var caliData = Sheetsee.makeColorArrayOfObject(cali, colors)
var lineOptions = { units: "units",
labels: "undefined",
m: [80, 100, 120, 100],
w: 800, h: 400,
div: "#pennies",
yaxis: "pennies",
hiColor: "#E4EB29"
}
Sheetsee.d3LineChart(caliData, lineOptions)
}
</script>
</body>
</html>