JqPlot を使用して作成された棒グラフがあります。次のようにレンダリングされます。
棒グラフの jQuery コードは次のとおりです。
$(document).ready(function(){
var plots = [[['US',330]], [['GB',300]], [['IN',230]], [['AU',70]], [['RoW',70]]]
var plot1 = $.jqplot('TopCountries', plots, {
// The "seriesDefaults" option is an options object that will
// be applied to all series in the chart.
animate: true,
// Will animate plot on calls to plot1.replot({resetAxes:true})
animateReplot: true,
seriesDefaults:{
renderer:$.jqplot.BarRenderer,
pointLabels: { show: true, location: 'n', edgeTolerance: -15 },
rendererOptions: {
fillToZero: true,
barWidth: 15,
shadow: false
}
},
// Custom labels for the series are specified with the "label"
// option on the series option. Here a series option object
// is specified for each series.
series:[
],
axes: {
// Use a category axis on the x axis and use our custom ticks.
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
//ticks: ticks
},
// Pad the y axis just a little so bars can get close to, but
// not touch, the grid boundaries. 1.2 is the default padding.
yaxis: {
pad: 1.05,
//tickOptions: {formatString: '$%d'}
}
}
});
});
これは完璧ですが、バー自体をより厚くしたいと思います. barWidth をより高く変更すると、棒は太くなりますが、左に整列しているように見え、棒がグラフから外れて表示されます。
理想的には、バーが目盛りのすぐ上にあることを望みます。edgeTolerance、fillToZero、yaxis パッドなどをいじってみましたが、違いはないようです。
私に何ができるか知っている人はいますか?