Skip to content

Commit b6511d0

Browse files
author
David Lawrence
committed
initial flot support
1 parent 17b7f71 commit b6511d0

File tree

4 files changed

+3151
-18
lines changed

4 files changed

+3151
-18
lines changed

css/main.css

+4-15
Original file line numberDiff line numberDiff line change
@@ -102,21 +102,10 @@ textarea {
102102
Author's custom styles
103103
========================================================================== */
104104

105-
106-
107-
108-
109-
110-
111-
112-
113-
114-
115-
116-
117-
118-
119-
105+
#chart {
106+
width: 50em;
107+
height: 25em;
108+
}
120109

121110
/* ==========================================================================
122111
Helper classes

index.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
</table>
6969
</div>
7070
<div class="col-md-8">
71-
<div>CHART HERE</div>
71+
<div id="chart"></div>
7272
</div>
7373
</div>
7474
</div>
@@ -114,6 +114,7 @@
114114
</script>
115115
<script src="js/vendor/require.min.js"></script>
116116
<script src="js/vendor/jquery.js"></script>
117+
<script src="js/vendor/jquery.flot.js"></script>
117118
<script src="js/plugins.js"></script>
118119
<script src="js/vendor/bootstrap.min.js"></script>
119120
</body>

js/main.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@ require(['jquery', 'es-glue', 'd3'], function ($, ES, d3) {
1111
'use strict';
1212

1313
ES.query(function(data, status, xhr) {
14-
console.log(data, status, xhr);
15-
});
14+
var d1 = [];
15+
for (var i = 0; i < 14; i += 0.5) {
16+
d1.push([i, Math.sin(i)]);
17+
}
18+
var d2 = [[0, 3], [4, 8], [8, 5], [9, 13]];
19+
var d3 = [[0, 12], [7, 12], null, [7, 2.5], [12, 2.5]];
20+
$.plot("#chart", [ d1, d2, d3 ]);
21+
});
1622

1723
});

0 commit comments

Comments
 (0)