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;
}
.flotr-legend-label {
font-size: 20px;
}
JavaScript
(function basic(container) {
var
d1 = [[0, 3], [4, 8], [8, 5], [9, 13]], // First data series
d2 = [], // Second data series
i, graph;
// Generate first data set
for (i = 0; i < 14; i += 0.5) {
d2.push([i, Math.sin(i)]);
}
// Draw Graph
graph = Flotr.draw(container, [
{ data : d1, label : 'a' },
{ data : d2, label : 'b'}
], {
xaxis: {
minorTickFreq: 4
},
legend: {
position : 'se'
},
grid: {
minorVerticalLines: true
},
HtmlText : true
}
);
})(document.getElementById("example"));