I need to add labels in the Jquery Flot chart. Currently it's only providing the labels on mouse over, instead of that I need to show the labels just after the bar. I have attached an image along with this question. In the position of hash (#) I need to place the bar labels there. Please get me a solution for this.
Thanks in Advance.
for (i = 0; i < bardata.length; i++) {
ds.push({
label: yearArry[i],
data : bardata[i],
});
}
var options = {
colors : colorArray,
grid : {
hoverable : true,
clickable : true,
tickColor : $chrt_border_color,
borderWidth : $chrt_border_width,
borderColor : $chrt_border_color,
},
series: {
stack:true,
bars: {
show : true,
barWidth : 0.8,
horizontal: true,
align: "center"
}
},
xaxis: {
tickFormatter: function(val, axis) { return val < axis.max ? abbreviateNumber(val) : "Cost"; }
},
yaxis: {
ticks: company_label
},
legend: {
show: showLegend,
position: "ne",
noColumns : 1,
backgroundOpacity: 0.5,
margin: [0, -70]
},
tooltip : true,
tooltipOpts : {
content : "<b>%s</b> : <span>$%x</span>",
defaultTheme : false,
}
};
// Plot the graph with the data and options provided
$.plot($("#flotchart"), ds, options);
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…