データ ラベルが有効になっている Highcharts グラフがあります。デフォルトでは、データ ラベルは各データ バーの最後に付けられます (このフィドルを参照してください: http://jsfiddle.net/cyphun/NHCvW )。
負のデータ ラベルを移動して、バーの端ではなく x 軸の横に表示することはできますか? これは、私がやりたいことのスクリーンショットです。
http://cl.ly/image/2G3F0I2l2m1z
これが私のハイチャートのサンプルコードのコピーです:
$(function () {
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'column'
},
plotOptions: {
column: {
dataLabels: {
enabled: true,
useHTML: true,
style: {
color: '#252525',
fontWeight: 'bold'
}
}
}
},
title: {
text: 'Column chart with negative values'
},
xAxis: {
categories: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas']
},
tooltip: {
formatter: function() {
return ''+
this.series.name +': '+ this.y +'';
}
},
credits: {
enabled: false
},
series: [{
name: 'Jane',
data: [2, -2, -3, 2, 1]
}]
});
});
});
助けてくれてありがとう!