本文整理汇总了Java中org.jfree.chart.renderer.category.BarRenderer3D.setLegendItemLabelGenerator方法的典型用法代码示例。如果您正苦于以下问题:Java BarRenderer3D.setLegendItemLabelGenerator方法的具体用法?Java BarRenderer3D.setLegendItemLabelGenerator怎么用?Java BarRenderer3D.setLegendItemLabelGenerator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.renderer.category.BarRenderer3D
的用法示例。
在下文中一共展示了BarRenderer3D.setLegendItemLabelGenerator方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createLegend
import org.jfree.chart.renderer.category.BarRenderer3D; //导入方法依赖的package包/类
protected JFreeChart createLegend(CategoryDataset dataset) {
// JFreeChart chart = ChartFactory.createAreaChart(
JFreeChart chart = ChartFactory.createBarChart3D(
chartTitle, // chart title
"Category", // domain axis label
"Value", // range axis label
dataset, // data
PlotOrientation.VERTICAL, // orientation
true, // include legend
true, // tooltips
false // urls
);
// NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...
chart.setBackgroundPaint(Color.white);
CategoryPlot plot = chart.getCategoryPlot();
BarRenderer3D renderer = (BarRenderer3D) plot.getRenderer();
// renderer.setDrawOutlines(true);
// renderer.setUseFillPaint(true);
// renderer.setFillPaint(Color.white);
renderer.setLegendItemLabelGenerator(new SOCRCategorySeriesLabelGenerator());
return chart;
}
示例2: createChart
import org.jfree.chart.renderer.category.BarRenderer3D; //导入方法依赖的package包/类
/**
* Creates a chart.
*
* @param dataset the dataset.
*
* @return The chart.
*/
protected JFreeChart createChart(CategoryDataset dataset) {
JFreeChart chart = ChartFactory.createBarChart3D(
chartTitle, // chart title
domainLabel, // domain axis label
rangeLabel, // range axis label
dataset, // data
PlotOrientation.HORIZONTAL, // orientation
!legendPanelOn, // include legend
true, // tooltips
false // urls
);
CategoryPlot plot = chart.getCategoryPlot();
plot.setForegroundAlpha(1.0f);
// left align the category labels...
CategoryAxis axis = plot.getDomainAxis();
CategoryLabelPositions p = axis.getCategoryLabelPositions();
CategoryLabelPosition left = new CategoryLabelPosition(
RectangleAnchor.LEFT, TextBlockAnchor.CENTER_LEFT,
TextAnchor.CENTER_LEFT, 0.0,
CategoryLabelWidthType.RANGE, 0.30f
);
axis.setCategoryLabelPositions(CategoryLabelPositions.replaceLeftPosition(p, left));
BarRenderer3D renderer = (BarRenderer3D) plot.getRenderer();
renderer.setLegendItemLabelGenerator(new SOCRCategorySeriesLabelGenerator());
setCategorySummary(dataset);
return chart;
}
示例3: createChart
import org.jfree.chart.renderer.category.BarRenderer3D; //导入方法依赖的package包/类
/**
* Creates a 3D bar chart.
*
* @param dataset the category dataset.
*
* @return The chart.
*/
protected JFreeChart createChart(CategoryDataset dataset) {
JFreeChart chart = ChartFactory.createBarChart3D(
chartTitle, // chart title
domainLabel, // domain axis label
rangeLabel, // range axis label
dataset, // data
PlotOrientation.VERTICAL, // orientation
!legendPanelOn, // include legend
true, // tooltips
false // urls
);
CategoryPlot plot = chart.getCategoryPlot();
plot.setDomainGridlinesVisible(true);
CategoryAxis axis = plot.getDomainAxis();
axis.setCategoryLabelPositions(
CategoryLabelPositions.createUpRotationLabelPositions(
Math.PI / 8.0));
BarRenderer3D renderer = (BarRenderer3D) plot.getRenderer();
renderer.setLegendItemLabelGenerator(new SOCRCategorySeriesLabelGenerator());
renderer.setDrawBarOutline(false);
setCategorySummary(dataset);
return chart;
}