//設置柱子上比例數值的顯示,如果按照默認方式顯示,數值爲方向正常顯示
//設置柱子上顯示的數據旋轉90度,最後一個參數爲旋轉的角度值/3.14
ItemLabelPosition itemLabelPosition= new ItemLabelPosition(
ItemLabelAnchor.INSIDE12,TextAnchor.CENTER_RIGHT,
TextAnchor.CENTER_RIGHT,-1.57D);
//下面的設置是爲了解決,當柱子的比例過小,而導致表示該柱子比例的數值無法顯示的問題
//設置不能在柱子上正常顯示的那些數值的顯示方式,將這些數值顯示在柱子外面
ItemLabelPosition itemLabelPositionFallback=new ItemLabelPosition(
ItemLabelAnchor.OUTSIDE12,TextAnchor.BASELINE_LEFT,
TextAnchor.HALF_ASCENT_LEFT,-1.57D);
//設置正常顯示的柱子label的position
renderer.setPositiveItemLabelPosition(itemLabelPosition);
renderer.setNegativeItemLabelPosition(itemLabelPosition);
//設置不能正常顯示的柱子label的position
renderer.setPositiveItemLabelPositionFallback(itemLabelPositionFallback);
renderer.setNegativeItemLabelPositionFallback(itemLabelPositionFallback);