本文整理汇总了Java中org.jfree.chart.renderer.category.BarRenderer.setSeriesItemLabelFont方法的典型用法代码示例。如果您正苦于以下问题:Java BarRenderer.setSeriesItemLabelFont方法的具体用法?Java BarRenderer.setSeriesItemLabelFont怎么用?Java BarRenderer.setSeriesItemLabelFont使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.renderer.category.BarRenderer
的用法示例。
在下文中一共展示了BarRenderer.setSeriesItemLabelFont方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testEquals_ObjectList
import org.jfree.chart.renderer.category.BarRenderer; //导入方法依赖的package包/类
@Test
public void testEquals_ObjectList() {
BarRenderer r1 = new BarRenderer();
r1.setSeriesItemLabelFont(0, new Font(Font.DIALOG, Font.BOLD, 10));
BarRenderer r2 = new BarRenderer();
r2.setSeriesItemLabelFont(0, new Font(Font.DIALOG, Font.BOLD, 10));
assertEquals(r1, r2);
r2.setSeriesItemLabelFont(1, new Font(Font.DIALOG, Font.PLAIN, 5));
assertNotEquals(r1, r2);
}
示例2: createGanttChart
import org.jfree.chart.renderer.category.BarRenderer; //导入方法依赖的package包/类
@Override
protected JFreeChart createGanttChart() throws JRException
{
JFreeChart jfreeChart = super.createGanttChart();
CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
categoryPlot.getDomainAxis().setCategoryLabelPositions(CategoryLabelPositions.STANDARD);
categoryPlot.setDomainGridlinesVisible(true);
categoryPlot.setDomainGridlinePosition(CategoryAnchor.END);
categoryPlot.setDomainGridlineStroke(new BasicStroke(
0.5f,
BasicStroke.CAP_BUTT,
BasicStroke.JOIN_MITER,
50,
new float[] {1},
0
)
);
categoryPlot.setDomainGridlinePaint(ChartThemesConstants.GRAY_PAINT_134);
categoryPlot.setRangeGridlinesVisible(true);
categoryPlot.setRangeGridlineStroke(new BasicStroke(
0.5f,
BasicStroke.CAP_BUTT,
BasicStroke.JOIN_MITER,
50,
new float[] {1},
0
)
);
categoryPlot.setRangeGridlinePaint(ChartThemesConstants.GRAY_PAINT_134);
categoryPlot.getDomainAxis().setTickLabelsVisible(
//barPlot.isShowTickLabels()
true
);
CategoryItemRenderer categoryRenderer = categoryPlot.getRenderer();
categoryRenderer.setBaseItemLabelsVisible(true);
BarRenderer barRenderer = (BarRenderer)categoryRenderer;
barRenderer.setSeriesPaint(0, ChartThemesConstants.EYE_CANDY_SIXTIES_COLORS.get(3));
barRenderer.setSeriesPaint(1, ChartThemesConstants.EYE_CANDY_SIXTIES_COLORS.get(0));
CategoryDataset categoryDataset = categoryPlot.getDataset();
if (categoryDataset != null)
{
for (int i = 0; i < categoryDataset.getRowCount(); i++)
{
barRenderer.setSeriesItemLabelFont(i, categoryPlot.getDomainAxis().getTickLabelFont());
barRenderer.setSeriesItemLabelsVisible(i, true);
}
}
categoryPlot.setOutlinePaint(Color.DARK_GRAY);
categoryPlot.setOutlineStroke(new BasicStroke(1.5f));
categoryPlot.setOutlineVisible(true);
return jfreeChart;
}
示例3: createGanttChart
import org.jfree.chart.renderer.category.BarRenderer; //导入方法依赖的package包/类
@Override
protected JFreeChart createGanttChart() throws JRException
{
JFreeChart jfreeChart = super.createGanttChart();
CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
categoryPlot.getDomainAxis().setCategoryLabelPositions(CategoryLabelPositions.STANDARD);
categoryPlot.setDomainGridlinesVisible(true);
categoryPlot.setDomainGridlinePosition(CategoryAnchor.END);
categoryPlot.setDomainGridlineStroke(new BasicStroke(
0.5f,
BasicStroke.CAP_BUTT,
BasicStroke.JOIN_MITER,
50,
new float[] {1},
0
)
);
categoryPlot.setDomainGridlinePaint(ChartThemesConstants.GRAY_PAINT_217);
categoryPlot.setRangeGridlinesVisible(true);
categoryPlot.setRangeGridlineStroke(new BasicStroke(
0.5f,
BasicStroke.CAP_BUTT,
BasicStroke.JOIN_MITER,
50,
new float[] {1},
0
)
);
categoryPlot.setRangeGridlinePaint(ChartThemesConstants.GRAY_PAINT_217);
// JRBarPlot barPlot = (BarPlot)categoryPlot;
// categoryPlot.getDomainAxis().setTickLabelsVisible(
// categoryPlot.getShowTickLabels() == null ? true : barPlot.getShowTickLabels().
// true
// );
CategoryItemRenderer categoryRenderer = categoryPlot.getRenderer();
categoryRenderer.setBaseItemLabelsVisible(true);
BarRenderer barRenderer = (BarRenderer)categoryRenderer;
@SuppressWarnings("unchecked")
List<Paint> seriesPaints = (List<Paint>)getDefaultValue(defaultChartPropertiesMap, ChartThemesConstants.SERIES_COLORS);
barRenderer.setSeriesPaint(0, seriesPaints.get(3));
barRenderer.setSeriesPaint(1, seriesPaints.get(0));
CategoryDataset categoryDataset = categoryPlot.getDataset();
if(categoryDataset != null)
{
for(int i = 0; i < categoryDataset.getRowCount(); i++)
{
barRenderer.setSeriesItemLabelFont(i, categoryPlot.getDomainAxis().getTickLabelFont());
barRenderer.setSeriesItemLabelsVisible(i, true);
// barRenderer.setSeriesPaint(i, GRADIENT_PAINTS[i]);
// CategoryMarker categoryMarker = new CategoryMarker(categoryDataset.getColumnKey(i),MARKER_COLOR, new BasicStroke(1f));
// categoryMarker.setAlpha(0.5f);
// categoryPlot.addDomainMarker(categoryMarker, Layer.BACKGROUND);
}
}
categoryPlot.setOutlinePaint(Color.DARK_GRAY);
categoryPlot.setOutlineStroke(new BasicStroke(1.5f));
categoryPlot.setOutlineVisible(true);
return jfreeChart;
}