1
0
Fork 0
forked from wezm/wezm.net

Switch to flot for charting

This commit is contained in:
Wesley Moore 2010-09-21 17:36:40 +10:00
parent 7b644ad56a
commit dcc9338a23
2 changed files with 4 additions and 10 deletions

View file

@ -2,7 +2,8 @@
<html>
<head>
<%= render '_head' %>
<script src="/js/dygraph-combined.js" type="text/javascript" charset="utf-8"></script>
<script src="/js/jquery.flot.min.js" type="text/javascript" charset="utf-8"></script>
<!--[if IE lt 9]><script language="javascript" type="text/javascript" src="/js/excanvas.min.js"></script><![endif]-->
<script src="/js/mojo.js" type="text/javascript" charset="utf-8"></script>
<script src="/js/weather.js" type="text/javascript" charset="utf-8"></script>
</head>

View file

@ -16,19 +16,12 @@ jQuery(function() {
// Populate the current conditions
var current_div = render_current(data.current);
// $(current_div).replace('.loading');
$('.loading').replaceWith(current_div)
// Populate the charts
$('.temperature.chart').each(function() {
var self = this;
var g = new Dygraph(
self,
data.history,
{
labels: ['Date', 'Indoor Temperature', 'Outdoor Temperature'],
rollPeriod: 3,
}
);
jQuery.plot(self, data.history, {});
});
});
});