Basic Flotr Example
HTML
<script src="https://rawgithub.com/HumbleSoftware/Flotr2/master/flotr2.min.js"></script>
<link rel="stylesheet" href="https://rawgithub.com/HumbleSoftware/Flotr2/master/examples/examples.css">
<div id="example"></div>
CSS
#example {
width: 680px;
height: 440px;
}
JavaScript
(function basic(container) {
var
d1 = [[0, 3], [4, 8], [8, 5], [9, 13],[13,4],[16,6],[19,8],[21,3],[26,9],[31,11],[37,13],[43,16],[49,21],[51,14],[54,26]], // First data series
d2 = [], // Second data series
i, graph;
// Generate first data set
for (i = 0; i < 4*14; i += 0.125) {
d2.push([i, 2*Math.sin(4*i)]);
}
// Draw Graph
graph = Flotr.draw(container, [ d1, d2 ], {
xaxis: {
minorTickFreq: 2
},
grid: {
minorVerticalLines: true
}
});
})(document.getElementById("example"));