本文整理汇总了Java中org.jfree.text.TextBlockAnchor.CENTER_LEFT属性的典型用法代码示例。如果您正苦于以下问题:Java TextBlockAnchor.CENTER_LEFT属性的具体用法?Java TextBlockAnchor.CENTER_LEFT怎么用?Java TextBlockAnchor.CENTER_LEFT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.jfree.text.TextBlockAnchor
的用法示例。
在下文中一共展示了TextBlockAnchor.CENTER_LEFT属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createChart
/**
* 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;
}
示例2: createChart
private JFreeChart createChart(final CategoryDataset dataset, String str) {
final JFreeChart chart = ChartFactory.createBarChart3D(
str, // chart title
"Names", // domain axis label
"Values(%)", // range axis label
dataset, // data
PlotOrientation.HORIZONTAL, // orientation
true, // include legend
true, // tooltips
false // urls
);
final CategoryPlot plot = chart.getCategoryPlot();
plot.setForegroundAlpha(1.0f);
// left align the category labels...
final CategoryAxis axis = plot.getDomainAxis();
final CategoryLabelPositions p = axis.getCategoryLabelPositions();
final CategoryLabelPosition left = new CategoryLabelPosition(
RectangleAnchor.LEFT, TextBlockAnchor.CENTER_LEFT,
TextAnchor.CENTER_LEFT, 0.0,
CategoryLabelWidthType.RANGE, 0.30f
);
axis.setCategoryLabelPositions(CategoryLabelPositions.replaceLeftPosition(p, left));
// change the auto tick unit selection to integer units only...
final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setRange(from, to);
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
return chart;
}
示例3: createChart
/**
* Creates a chart.
*
* @param dataset the dataset.
*
* @return The chart.
*/
private JFreeChart createChart(final CategoryDataset dataset) {
final JFreeChart chart = ChartFactory.createBarChart3D(
"3D Bar Chart Demo 2", // chart title
"Category", // domain axis label
"Value", // range axis label
dataset, // data
PlotOrientation.HORIZONTAL, // orientation
true, // include legend
true, // tooltips
false // urls
);
final CategoryPlot plot = chart.getCategoryPlot();
plot.setForegroundAlpha(1.0f);
// left align the category labels...
final CategoryAxis axis = plot.getDomainAxis();
final CategoryLabelPositions p = axis.getCategoryLabelPositions();
final CategoryLabelPosition left = new CategoryLabelPosition(
RectangleAnchor.LEFT, TextBlockAnchor.CENTER_LEFT,
TextAnchor.CENTER_LEFT, 0.0,
CategoryLabelWidthType.RANGE, 0.30f
);
axis.setCategoryLabelPositions(CategoryLabelPositions.replaceLeftPosition(p, left));
return chart;
}