Multi series bar chart to display point label
I need to display the customized label in each bar. It is a multiseries bar chart using jqplot. I'm pasting my code here. This code is not working. Showing me a separate bar instead of multiseries. Please help me..
function plotJQBarChart(cri开发者_如何学运维tical, major, minor, warning) {
var s1 = [32, 65, 57, 10];
var s2 = [45, 56, 90, 30];
var ticks = ['Critical', 'Major', 'Minor', 'Warning'];
plot1 = $.jqplot('JQPlotBar', [s1,s2], {
color: '#657383',
shadow: true,
grid:{background:'#F1F1F1',
borderWidth:0.0,
drawGridLines: false},
seriesColors: ['#9E7BFF','#3BB9FF'],
barPadding: 2,
seriesDefaults:{
renderer:$.jqplot.BarRenderer,
pointLabels: { show: true,labels:
['Severity', 'Wifi','Severity', 'Wifi',
'Severity', 'Wifi','Severity', 'Wifi',
'Severity', 'Wifi','Severity', 'Wifi',
'Severity', 'Wifi','Severity', 'Wifi'] }
},
legend:{
show:true,
placement: 'outside',
rendererOptions: {
numberRows: 1
},
location:'e',
marginTop: '15px',
labels:['Wifi','Severity']
},
axes: {
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
ticks: ticks
}
},
highlighter: { show: false }
});
}
Did you try adding: stackSeries: true
to your configuration?
Also, the way you are adding point labels is not right. See http://www.jqplot.com/tests/point-labels.php
Try to put pointLabels
to each label in series
property
series:[
{label:'Serie X', pointLabels: { show: true }},
{label:'Serie Y', pointLabels: { show: true }},
{label:'Serie Z', pointLabels: { show: true }}
],
精彩评论