java - JFreechart 标签太小

标签 java eclipse-plugin swt eclipse-rcp jfreechart

我正在为 eclipse rcp 插件创建一个新 View 。在此 View 中,我想使用固定高度为 20 的 JFreeChart horizo​​ntal(!) StackedBar。问题是,项目标签显示得太小,尽管有很多空间可以显示得更大(见图)设置更大使用“setSeriesItemLabelFont()”的大小不会增加标签的高度,只会增加宽度

图片:

image

这是我的代码: View 部分:

@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);
}

最佳答案

您正在使用 SWT_AWT,也许这就是问题所在。有 org.jfree.experimental.chart.swt.ChartComposite,它有助于在 SWT 中显示图表。看例子:http://codeandme.blogspot.ru/2012/12/using-jfreechart-in-your-rcp.html

关于java - JFreechart 标签太小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10997203/

相关文章:

java - 在 Guice 中使用 Mapbinder 在模块中使用 Inject

java - 如何显示Java ArrayList的内容?

java - Eclipse插件中是否需要配置资源

Java 初学者 : the mechanism behind "|" operator in Shell s = new Shell(d, SWT.CLOSE | SWT.调整大小);

java - 如何在visio中以编程方式绘制流程图

java - 将十六进制字符串转换为图像文件

java - 未调用自定义 ArrayAdapter getFilter()

运行JUnit插件测试时出现java.lang.NoClassDefFoundError

java - 如何在 ResourceChangeListener(eclipse 插件)中添加标记?

java - 如何在我的 SWT 应用程序上使用 IBM 的小部件 (com.ibm.rcp.swt.swidgets)?