Bar with different color Flot Graph
Bar with different color Flot Graph
by Keyur Patel
HTML
<script src="http://people.iola.dk/olau/flot/jquery.flot.js"></script>
<div id="graph3">f</div>
CSS
#graph3 { width: 300px; height: 300px; }
JavaScript
var options3 = {
grid: {
hoverable: true
},
series: {
bars: {
show: true,
barWidth: 0.6,
align: "center"
}
},
yaxis: {
min: 0,
tickSize: 1
},
xaxis: {
ticks: [
[0, 'True'],
[1, 'False']
],
tickLength: 0
},
tooltip: true,
tooltipOpts: {
content: '%y Votes',
defaultTheme: false
},
colors: ["#FF0000", "#00FF00"]
};
var data3 = [
[[0, 3]],
[[1, 9]]
];
$.plot($('#graph3'), data3, options3);