棒グラフにjqPlot グラフを使用しています
コード :
<script type="text/javascript">
$(document).ready(function () {
var s1 = [48,32,15,10,5,5,3,3];
var s2 = [37,27,10,7,3,3,1,1];
var ticks =["ID theft","CI","GLT","Rx Card","SI term","AD+","GIWL","P and C"];
plot2 = $.jqplot('chart2', [s1,s2], {
seriesDefaults: {
renderer: $.jqplot.BarRenderer,
pointLabels: { show: true }
},
series:[
{label:'#2012'},
{label:'#2013'}
],
legend: {
show: true,
location: 'e',
placement: 'inside'
},
axes: {
xaxis:{
ticks:ticks,
renderer:$.jqplot.CategoryAxisRenderer,
tickOptions:{markSize:0}
},
yaxis:{ticks:[0, 100], tickOptions:{formatString:'%d\%'}}
}
});
$('#chart2').bind('jqplotDataHighlight',
function (ev, seriesIndex, pointIndex, data) {
$('#info2').html('series: ' + seriesIndex + ', point: ' + pointIndex + ', data: ' + data);
}
);
$('#chart2').bind('jqplotDataUnhighlight',
function (ev) {
$('#info2').html('Nothing');
}
);
});
問題 :: 凡例がグラフに正しく表示されない