Skip to content

Instantly share code, notes, and snippets.

@gidili
Created July 14, 2012 00:40
Show Gist options
  • Save gidili/3108480 to your computer and use it in GitHub Desktop.
Save gidili/3108480 to your computer and use it in GitHub Desktop.
reproduces a visual issue with flot on chrome
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script src="./js/jquery-1.7.2.min.js"></script>
<script src="./js/jquery.flot.js"></script>
<script type="text/javascript">
var plot = null;
var flotOptions = { yaxis: { min: -30, max: 125 }, xaxis: { show: false, min: 0, max: 100 }, series: { shadowSize: 0 }, grid: { backgroundColor: { colors: ["#fff", "#eee"] } } };
function refreshChart(points)
{
plot.setData([{data: points, label: "mV", color: "#4AA02C"}]);
//plot.setupGrid();
plot.draw();
}
function getDataset()
{
var points = [];
for(var i =0; i < 10000; i++){
points.push([0.01*i, 10]);
}
refreshChart(points);
}
$(document).ready(function(){
plot = $.plot($("#placeholder"), [{data: [], label: "mV", color: "#4AA02C"}], flotOptions);
t = setInterval(getDataset, 100);
});
</script>
</head>
<body>
<center>
<div id="placeholder" style="width: 600px; height: 350px;"></div>
</center>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment