Skip to content

Instantly share code, notes, and snippets.

@muhqu
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save muhqu/8891318 to your computer and use it in GitHub Desktop.
Save muhqu/8891318 to your computer and use it in GitHub Desktop.
<html>
<head>
<style type="text/css">
body {
margin: 0; padding: 0 2px 0 2px;
white-space: nowrap;
font-family: "Lucida Grande";
font-size: 10.5pt;
line-height: 22px;
}
.updating-chart {
display: none;
}
.peity {
display: inline-block;
position: absolute;
margin: 2px 0 0 2px;
}
</style>
<script type="text/javascript" src="assets/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="assets/jquery.peity.min.js"></script>
</head>
<body>
<div id="dynamic">
JS Menu <span class="updating-chart">5,3,9,6,5,9,7,3,5,2,5,3,9,6,5,9,7,3,5,2</span>
</div>
<script>
jQuery(function($){
var updatingChart = $(".updating-chart").peity("line", { width: 78 });
// BitBar.showWebInspector();
setInterval(function() {
var random = Math.round(Math.random() * 10)
var values = updatingChart.text().split(",")
values.shift()
values.push(random)
updatingChart
.text(values.join(","))
.change()
}, 1000);
$('#dynamic').click(function () {
BitBar.resetMenu();
BitBar.addMenuItem({title:"Graphs via Peity by @benpickles",href:"http://benpickles.github.io/peity/"});
BitBar.showMenu();
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment