4

我是 JFreechart 的新手,我已经生成了一个条形图。酒吧里有一条闪亮的线。我想知道是否有可能摆脱酒吧中的这条线。我希望酒吧具有哑光效果。我附上了我生成的条形图的图像。任何指针都会有很大帮助。

提前致谢。

在此处输入图像描述

SSCCE:

public JFreeChart createBarChart(CategoryDataset dataset) {
    // TODO Auto-generated method stub
    String unter_title="No of counts";
    JFreeChart jfreechart = ChartFactory.createBarChart(title, unter_title, "frequencies", dataset, PlotOrientation.VERTICAL, true, true, false);
    String text="Test Start Time: "+(new Date(test.getStart_utc_timestamp()).toString()+" "+"Test End Time: "+new Date(test.getEnd_utc_timestamp()));
    jfreechart.addSubtitle(new TextTitle(text, new Font("Dialog", 3, 10)));
    CategoryPlot categoryplot = (CategoryPlot)jfreechart.getPlot();
    categoryplot.setDomainGridlinesVisible(true);
    categoryplot.setRangePannable(true);
    NumberAxis numberaxis = (NumberAxis)categoryplot.getRangeAxis();
    numberaxis.setNumberFormatOverride(NumberFormat.getPercentInstance());
    numberaxis.setUpperMargin(0.10000000000000001D);

    BarRenderer barrenderer = (BarRenderer)categoryplot.getRenderer();
    barrenderer.setDrawBarOutline(false);
    barrenderer.setSeriesPaint(0, Color.DARK_GRAY);

    barrenderer.setMaximumBarWidth(0.0500000000000000001D);
    barrenderer.setLegendItemToolTipGenerator(new StandardCategorySeriesLabelGenerator("Tooltip: {0}"));
    CategoryAxis categoryaxis = categoryplot.getDomainAxis();
    return jfreechart;
}
4

1 回答 1

6

亮点是GradientBarPainter. 相反,请按照此处StandardBarPainter的建议尝试。

于 2013-07-31T16:48:31.033 回答