2
我正在爲eclipse rcp插件創建一個新視圖。在這個視圖中,我想使用一個JFreeChart水平(!)StackedBar,其高度爲20。問題是,儘管有很多空間可以放大顯示,但項目標籤顯示得太小(請參閱圖片)與大小 「setSeriesItemLabelFont()」 將不會增加高的標籤,但僅在寬度上的JFreechart標籤太小
圖片:
image http://s14.directupload.net/images/120612/n2zm8rkh.png
這裏是我的代碼: 的ViewPart時:
@Override
public void createPartControl(Composite parent) {
GridLayout gridLayout = new GridLayout(1, false);
parent.setLayout(gridLayout);
totalRenderingContent = new TotalRenderingContent(parent);
}
和TotalRenderingContent.java
public TotalRenderingContent(Composite parent) {
chartComposite = new Composite(parent, SWT.EMBEDDED);
GridData gridDataChart = new GridData(GridData.FILL, GridData.FILL, true, false);
gridDataChart.heightHint = 20;
chartComposite.setLayoutData(gridDataChart);
chartFrame = SWT_AWT.new_Frame(chartComposite);
createTotalRenderingContent();
}
private void createTotalRenderingContent() {
Chart renderingChart = new TotalRenderingChart();
JFreeChart chart = renderingChart.getChart();
ChartPanel chartPanel = new ChartPanel(chart);
chartFrame.add(chartPanel);
}