本文整理汇总了Java中org.jfree.chart.renderer.category.StackedBarRenderer.setDrawBarOutline方法的典型用法代码示例。如果您正苦于以下问题:Java StackedBarRenderer.setDrawBarOutline方法的具体用法?Java StackedBarRenderer.setDrawBarOutline怎么用?Java StackedBarRenderer.setDrawBarOutline使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.renderer.category.StackedBarRenderer
的用法示例。
在下文中一共展示了StackedBarRenderer.setDrawBarOutline方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createChart
import org.jfree.chart.renderer.category.StackedBarRenderer; //导入方法依赖的package包/类
/**
* Creates a sample chart.
*
* @param dataset the dataset for the chart.
*
* @return a sample chart.
*/
protected JFreeChart createChart(CategoryDataset dataset) {
JFreeChart chart = ChartFactory.createStackedBarChart(
chartTitle, // chart title
domainLabel, // domain axis label
rangeLabel, // range axis label
dataset, // data
PlotOrientation.VERTICAL, // the plot orientation
!legendPanelOn, // legend
true, // tooltips
false // urls
);
chart.setBackgroundPaint(Color.white);
CategoryPlot plot = (CategoryPlot) chart.getPlot();
plot.setBackgroundPaint(Color.lightGray);
plot.setRangeGridlinePaint(Color.white);
StackedBarRenderer renderer = (StackedBarRenderer) plot.getRenderer();
renderer.setDrawBarOutline(false);
renderer.setBaseItemLabelsVisible(true);
renderer.setSeriesItemLabelGenerator(0, new StandardCategoryItemLabelGenerator());
renderer.setLegendItemLabelGenerator(new SOCRCategorySeriesLabelGenerator());
setCategorySummary(dataset);
return chart;
}
示例2: createChart
import org.jfree.chart.renderer.category.StackedBarRenderer; //导入方法依赖的package包/类
private static JFreeChart createChart(GraphDataItem item, CategoryDataset categorydataset) {
JFreeChart jfreechart = ChartFactory.createStackedBarChart(item.getTitle(), item.getLineXName(),
item.getLineYName(), categorydataset, PlotOrientation.VERTICAL, true, true, false);
Font font = new Font("宋体", Font.PLAIN, 13);
jfreechart.getTitle().setFont(font);
jfreechart.getLegend().setItemFont(font);
CategoryPlot categoryplot = (CategoryPlot) jfreechart.getPlot();
categoryplot.getDomainAxis().setTickLabelFont(font);
categoryplot.getDomainAxis().setLabelFont(font);
categoryplot.getDomainAxis().setCategoryLabelPositions(
CategoryLabelPositions.createUpRotationLabelPositions(0.392D));
categoryplot.getRangeAxis().setTickLabelFont(font);
categoryplot.getRangeAxis().setLabelFont(font);
categoryplot.setBackgroundPaint(ChartColor.WHITE);
StackedBarRenderer stackedbarrenderer = (StackedBarRenderer) categoryplot.getRenderer();
stackedbarrenderer.setDrawBarOutline(false);
stackedbarrenderer.setBaseItemLabelsVisible(true);
stackedbarrenderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator());
// int index = 0;
// for (Object name : item.getDatas().keySet()) {
// stackedbarrenderer
// .setSeriesPaint(categorydataset.getRowIndex((String) name), COLORS[index % COLORS.length]);
// index++;
//
// }
return jfreechart;
}
示例3: makeSequenceLogo
import org.jfree.chart.renderer.category.StackedBarRenderer; //导入方法依赖的package包/类
/**
* Creates the logo instance
*/
private void makeSequenceLogo()
{
CategoryDataset dataSet = prepareData();
chart = ChartFactory.createStackedBarChart(
null,
"",
this.asBit ? "Bit Score" : "Frequency",
dataSet,
PlotOrientation.VERTICAL,
false,
true,
false
);
//set modified painter
StackedBarRenderer renderer = new StackedBarRenderer();
renderer.setBarPainter(new LogoBarPainter(letter_matrix));
chart.getCategoryPlot().setRenderer(renderer);
//disable shadows
renderer.setShadowVisible(false);
CategoryPlot plot = chart.getCategoryPlot();
//space between bars
plot.getDomainAxis().setCategoryMargin(0.05);
plot.getDomainAxis().setLowerMargin(0.01);
plot.getDomainAxis().setUpperMargin(0.01);
//paint outlines around letters
renderer.setDrawBarOutline(false);
//background, transparent
plot.setBackgroundPaint(null);
plot.setBackgroundAlpha(0.0f);
chart.setBackgroundPaint(null);
//remove horizontal lines
plot.setDomainGridlinesVisible(false);
plot.setRangeGridlinesVisible(false);
//disable border
plot.setOutlineVisible(false);
//rotate category axis 45 degrees, but only for context
if (letters == contexts)
{
CategoryAxis domainAxis = plot.getDomainAxis();
domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_45);
}
//y axis ticks
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setTickUnit(new NumberTickUnit(1));
//ranges
if (this.asBit)
{
plot.getRangeAxis().setRange(0, 2);
}
else
{
plot.getRangeAxis().setRange(0, 1);
}
}
示例4: getRawLogoPanel
import org.jfree.chart.renderer.category.StackedBarRenderer; //导入方法依赖的package包/类
public ChartPanel getRawLogoPanel()
{
CategoryDataset dataSet = prepareData();
JFreeChart rawchart = ChartFactory.createStackedBarChart(
null,
"",
null,
dataSet,
PlotOrientation.VERTICAL,
false,
true,
false
);
//set modified painter
StackedBarRenderer renderer = new StackedBarRenderer();
renderer.setBarPainter(new LogoBarPainter(letter_matrix));
rawchart.getCategoryPlot().setRenderer(renderer);
//disable shadows
renderer.setShadowVisible(false);
CategoryPlot plot = rawchart.getCategoryPlot();
//space between bars
plot.getDomainAxis().setCategoryMargin(0.05);
plot.getDomainAxis().setLowerMargin(0.01);
plot.getDomainAxis().setUpperMargin(0.01);
//paint outlines around letters
renderer.setDrawBarOutline(false);
//background, transparent
plot.setBackgroundPaint(null);
plot.setBackgroundAlpha(0.0f);
rawchart.setBackgroundPaint(null);
//disable border
plot.setOutlineVisible(false);
//remove axis ticks
plot.getRangeAxis().setVisible(false);
plot.getDomainAxis().setVisible(false);
//ranges
if (this.asBit)
{
plot.getRangeAxis().setRange(0, 2);
}
else
{
plot.getRangeAxis().setRange(0, 1);
}
return new ChartPanel(rawchart);
}
示例5: getSummaryLogoPanel
import org.jfree.chart.renderer.category.StackedBarRenderer; //导入方法依赖的package包/类
public ChartPanel getSummaryLogoPanel()
{
CategoryDataset dataSet = prepareData();
JFreeChart rawchart = ChartFactory.createStackedBarChart(
null,
"",
null,
dataSet,
PlotOrientation.VERTICAL,
false,
true,
false
);
//set modified painter
StackedBarRenderer renderer = new StackedBarRenderer();
renderer.setBarPainter(new LogoBarPainter(letter_matrix));
rawchart.getCategoryPlot().setRenderer(renderer);
//disable shadows
renderer.setShadowVisible(false);
CategoryPlot plot = rawchart.getCategoryPlot();
//space between bars
plot.getDomainAxis().setCategoryMargin(0.05);
plot.getDomainAxis().setLowerMargin(0.01);
plot.getDomainAxis().setUpperMargin(0.01);
//remove horizontal lines
plot.setDomainGridlinesVisible(false);
plot.setRangeGridlinesVisible(false);
//paint outlines around letters
renderer.setDrawBarOutline(false);
//background, transparent
plot.setBackgroundPaint(null);
plot.setBackgroundAlpha(0.0f);
rawchart.setBackgroundPaint(null);
//disable border
plot.setOutlineVisible(false);
//axis ticks
plot.getRangeAxis().setVisible(true);
plot.getDomainAxis().setVisible(true);
//ranges
if (this.asBit)
{
plot.getRangeAxis().setRange(0, 2);
}
else
{
plot.getRangeAxis().setRange(0, 1);
}
return new ChartPanel(rawchart);
}