Basic Flotr Example
HTML
<script src="https://raw.github.com/HumbleSoftware/Flotr2/master/flotr2.min.js"></script>
<link rel="stylesheet" href="https://raw.github.com/HumbleSoftware/Flotr2/master/examples/examples.css">
<div id="example"></div>
CSS
#example {
width: 340px;
height: 220px;
}
JavaScript
(function basic(container) {
var
data = [],
options, i, graph;
// Sample the sine function for data
for (i = 0; i < 4 * Math.PI; i += 0.05) {
data.push([i, Math.sin(i)]);
}
data.push([4 * Math.PI, Math.sin(4 * Math.PI)]);
console.log(data);
// Draw Graph
graph = Flotr.draw(container, [data], {
'lines': {
lineWidth: 1,
show: true,
fill: true,
fillOpacity: 0.2,
steps: false
},
yaxis: {
min: -1,
max: .5
}
});
})(document.getElementById("example"));