本文整理汇总了Java中org.jfree.chart.renderer.category.StackedAreaRenderer.setSeriesPaint方法的典型用法代码示例。如果您正苦于以下问题:Java StackedAreaRenderer.setSeriesPaint方法的具体用法?Java StackedAreaRenderer.setSeriesPaint怎么用?Java StackedAreaRenderer.setSeriesPaint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.renderer.category.StackedAreaRenderer
的用法示例。
在下文中一共展示了StackedAreaRenderer.setSeriesPaint方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createTestsResultsChartHelper
import org.jfree.chart.renderer.category.StackedAreaRenderer; //导入方法依赖的package包/类
/**
*
*/
private static void createTestsResultsChartHelper(final String categoryLabel, final DefaultCategoryDataset dataset, final OutputStream out, final CategoryLabelPositions categoryLabelPosition) throws IOException {
final JFreeChart chart = ChartFactory.createStackedAreaChart(null,
categoryLabel, "Tests", dataset,
PlotOrientation.VERTICAL,
true, false, false);
chart.setBackgroundPaint(Color.white);
// change the auto tick unit selection to integer units only
final CategoryPlot plot = chart.getCategoryPlot();
final LogarithmicAxis logarithmicAxis = new LogarithmicAxis("Tests");
logarithmicAxis.setStrictValuesFlag(false);
logarithmicAxis.setAutoRangeIncludesZero(true);
logarithmicAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
plot.setRangeAxis(logarithmicAxis);
// final NumberAxis rangeAxis = (NumberAxis)plot.getRangeAxis();
// rotate X dates
final CategoryAxis domainAxis = plot.getDomainAxis();
domainAxis.setCategoryLabelPositions(categoryLabelPosition);
// set area colors
final StackedAreaRenderer area = (StackedAreaRenderer) plot.getRenderer();
area.setSeriesPaint(0, Color.RED); // first area
area.setSeriesPaint(1, Color.PINK); // second area
area.setSeriesPaint(2, Color.GREEN); // thirs area
//plot.setRenderer(area);
// write to reposnce
final ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection());
ChartUtilities.writeChartAsPNG(out, chart, IMG_WIDTH, IMG_HEIGHT, info);
}
示例2: getStackedAreaRenderer
import org.jfree.chart.renderer.category.StackedAreaRenderer; //导入方法依赖的package包/类
/**
* Returns a stacked area renderer.
*/
private AreaRenderer getStackedAreaRenderer()
{
StackedAreaRenderer renderer = new StackedAreaRenderer();
for ( int i = 0; i < COLORS.length; i++ )
{
renderer.setSeriesPaint( i, COLORS[i] );
}
return renderer;
}
示例3: createGraph
import org.jfree.chart.renderer.category.StackedAreaRenderer; //导入方法依赖的package包/类
@Override
protected JFreeChart createGraph()
{
DataSetBuilder<Row, NumberOnlyBuildLabel> dataSetBuilder = new DataSetBuilder<Row, NumberOnlyBuildLabel>();
for (GraphPoint point : points)
{
dataSetBuilder.add(point.getConcernDiagnosticsCount(), CONCERN_ROW, new NumberOnlyBuildLabel(point.getBuild()));
dataSetBuilder.add(point.getWarningDiagnosticsCount(), WARNING_ROW, new NumberOnlyBuildLabel(point.getBuild()));
dataSetBuilder.add(point.getErrorDiagnosticsCount(), ERROR_ROW, new NumberOnlyBuildLabel(point.getBuild()));
}
final JFreeChart chart = ChartFactory.createStackedAreaChart(
null, // chart title
null, // category axis label
"Diagnostics", // value axis label
dataSetBuilder.build(), // dataset
PlotOrientation.VERTICAL, // orientation
false, // include legend
true, // tooltips
true // urls
);
chart.setBackgroundPaint(Color.white);
final CategoryPlot plot = chart.getCategoryPlot();
plot.setBackgroundPaint(Color.WHITE);
plot.setOutlinePaint(null);
plot.setRangeGridlinesVisible(true);
plot.setRangeGridlinePaint(Color.black);
CategoryAxis domainAxis = new ShiftedCategoryAxis("Build Number");
plot.setDomainAxis(domainAxis);
domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
domainAxis.setLowerMargin(0.0);
domainAxis.setUpperMargin(0.0);
domainAxis.setCategoryMargin(0.0);
final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
StackedAreaRenderer renderer = new StackedAreaRenderer2();
plot.setRenderer(renderer);
renderer.setSeriesPaint(2, RED);
renderer.setSeriesPaint(1, YELLOW);
renderer.setSeriesPaint(0, CYAN);
// crop extra space around the graph
plot.setInsets(new RectangleInsets(5.0, 0, 0, 5.0));
return chart;
}