本文整理汇总了Java中org.jfree.chart.renderer.xy.XYBarRenderer.setSeriesOutlinePaint方法的典型用法代码示例。如果您正苦于以下问题:Java XYBarRenderer.setSeriesOutlinePaint方法的具体用法?Java XYBarRenderer.setSeriesOutlinePaint怎么用?Java XYBarRenderer.setSeriesOutlinePaint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.renderer.xy.XYBarRenderer
的用法示例。
在下文中一共展示了XYBarRenderer.setSeriesOutlinePaint方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setTheme
import org.jfree.chart.renderer.xy.XYBarRenderer; //导入方法依赖的package包/类
private final void setTheme(final JFreeChart chart) {
final XYPlot plot = (XYPlot) chart.getPlot();
final XYBarRenderer r = (XYBarRenderer) plot.getRenderer();
final StandardXYBarPainter bp = new StandardXYBarPainter();
r.setBarPainter(bp);
r.setSeriesOutlinePaint(0, Color.lightGray);
r.setShadowVisible(false);
r.setDrawBarOutline(false);
setBackgroundDefault(chart);
final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
// rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
rangeAxis.setTickLabelsVisible(false);
rangeAxis.setTickMarksVisible(false);
final NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();
domainAxis.setTickLabelsVisible(false);
domainAxis.setTickMarksVisible(false);
}
示例2: createChart
import org.jfree.chart.renderer.xy.XYBarRenderer; //导入方法依赖的package包/类
protected JFreeChart createChart( final IntervalXYDataset dataset, final String title, final String units )
{
final JFreeChart chart = ChartFactory.createXYBarChart(
title,
"Distance [" + units + "]",
false,
"Count",
dataset,
PlotOrientation.VERTICAL,
false, // legend
false,
false );
final NumberAxis range = (NumberAxis) chart.getXYPlot().getDomainAxis();
range.setRange( getMin(), getMax() );
final XYPlot plot = chart.getXYPlot();
final XYBarRenderer renderer = (XYBarRenderer) plot.getRenderer();
renderer.setSeriesPaint( 0, Color.red );
renderer.setDrawBarOutline( true );
renderer.setSeriesOutlinePaint( 0, Color.black );
renderer.setBarPainter( new StandardXYBarPainter() );
return chart;
}
示例3: configureXYBarRenderer
import org.jfree.chart.renderer.xy.XYBarRenderer; //导入方法依赖的package包/类
private static void configureXYBarRenderer(XYBarRenderer renderer, ValueSource valueSource, PlotInstance plotInstance) {
StandardXYBarPainter barPainter = new StandardXYBarPainter();
renderer.setBarPainter(barPainter);
renderer.setGradientPaintTransformer(null);
SeriesFormat seriesFormat = valueSource.getSeriesFormat();
DimensionConfig domainConfig = valueSource.getDomainConfig();
ValueSourceData valueSourceData = plotInstance.getPlotData().getValueSourceData(valueSource);
int seriesCount;
if (valueSourceData != null) {
seriesCount = valueSourceData.getSeriesCount();
} else {
seriesCount = 0;
}
DimensionConfig colorDimensionConfig = plotInstance.getCurrentPlotConfigurationClone().getDimensionConfig(
PlotDimension.COLOR);
// don't need shapeDimensionConfig, since the shape can't be represented for bars.
// Loop all series and set series format.
// Format based on dimension configs will be set later on in initFormatDelegate().
for (int seriesIdx = 0; seriesIdx < seriesCount; ++seriesIdx) {
// configure series paint if necessary
if (!SeriesFormat.calculateIndividualFormatForEachItem(domainConfig, colorDimensionConfig)) {
renderer.setSeriesPaint(seriesIdx, seriesFormat.getAreaFillPaint());
}
// configure general style of the bars
renderer.setShadowVisible(false);
renderer.setSeriesOutlinePaint(seriesIdx, PlotConfiguration.DEFAULT_SERIES_OUTLINE_PAINT);
}
renderer.setDrawBarOutline(true);
}
示例4: setTheme
import org.jfree.chart.renderer.xy.XYBarRenderer; //导入方法依赖的package包/类
static private final void setTheme(final JFreeChart chart) {
XYPlot plot = (XYPlot) chart.getPlot();
XYBarRenderer r = (XYBarRenderer) plot.getRenderer();
StandardXYBarPainter bp = new StandardXYBarPainter();
r.setBarPainter(bp);
r.setSeriesOutlinePaint(0, Color.lightGray);
r.setShadowVisible(false);
r.setDrawBarOutline(false);
setBackgroundDefault(chart);
}
示例5: configureXYBarRenderer
import org.jfree.chart.renderer.xy.XYBarRenderer; //导入方法依赖的package包/类
private static void configureXYBarRenderer(XYBarRenderer renderer, ValueSource valueSource, PlotInstance plotInstance) {
StandardXYBarPainter barPainter = new StandardXYBarPainter();
renderer.setBarPainter(barPainter);
renderer.setGradientPaintTransformer(null);
SeriesFormat seriesFormat = valueSource.getSeriesFormat();
DimensionConfig domainConfig = valueSource.getDomainConfig();
ValueSourceData valueSourceData = plotInstance.getPlotData().getValueSourceData(valueSource);
int seriesCount;
if (valueSourceData != null) {
seriesCount = valueSourceData.getSeriesCount();
} else {
seriesCount = 0;
}
DimensionConfig colorDimensionConfig = plotInstance.getCurrentPlotConfigurationClone().getDimensionConfig(PlotDimension.COLOR);
// don't need shapeDimensionConfig, since the shape can't be represented for bars.
// Loop all series and set series format.
// Format based on dimension configs will be set later on in initFormatDelegate().
for(int seriesIdx = 0; seriesIdx < seriesCount; ++seriesIdx) {
// configure series paint if necessary
if (!SeriesFormat.calculateIndividualFormatForEachItem(domainConfig, colorDimensionConfig)) {
renderer.setSeriesPaint(seriesIdx, seriesFormat.getAreaFillPaint());
}
// configure general style of the bars
renderer.setShadowVisible(false);
renderer.setSeriesOutlinePaint(seriesIdx, PlotConfiguration.DEFAULT_SERIES_OUTLINE_PAINT);
}
renderer.setDrawBarOutline(true);
}
示例6: generateDiagram
import org.jfree.chart.renderer.xy.XYBarRenderer; //导入方法依赖的package包/类
private static void generateDiagram(double[] results2, int bins) {
double[] buffer = new double[results2.length];
for (int i = 0; i < results2.length; i++)
buffer[i] = results2[i];
// The histogram takes an array
HistogramDataset histo = new HistogramDataset();
histo.addSeries("Relative Occurence of Duration", buffer, bins);
histo.setType(HistogramType.RELATIVE_FREQUENCY);
//histo.setType(HistogramType.SCALE_AREA_TO_1);
JFrame aFrame = new JFrame("Time analysis");
//ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
JFreeChart chart = ChartFactory.createHistogram("Distribution of simulated workflow duration",
"Duration of Workflow execution in ms", "Relative occurence", histo, PlotOrientation.VERTICAL, true, true, false);
// to save as JPG
XYPlot plot = (XYPlot) chart.getPlot();
XYBarRenderer renderer = (XYBarRenderer) plot.getRenderer();
renderer.setDrawBarOutline(false);
renderer.setSeriesOutlinePaint(0, Color.red);
//plot.getRangeAxis().setRange(0, 0.2);
//plot.getDomainAxis().setRange(0, 30);
plot.getRangeAxis().setTickLabelFont(new Font("Arial", 0, 30));
plot.getDomainAxis().setTickLabelFont(new Font("Arial", 0, 30));
plot.getRangeAxis().setLabelFont(new Font("Arial", 1, 28));
plot.getDomainAxis().setLabelFont(new Font("Arial", 1, 28));
//plot.getLegendItems().get(0).set(new Font("Arial", 1, 26));
//plot.getLegendItems().get(1).setLabelFont(new Font("Arial", 1, 24));
LegendTitle legend = chart.getLegend();
Font nwfont = new Font("Arial", 0, 26);
legend.setItemFont(nwfont);
//chart.setLegend(legend);
ChartPanel panel = new ChartPanel(chart);
panel.setPreferredSize(new java.awt.Dimension(900, 600));
aFrame.setContentPane(panel);
aFrame.setPreferredSize(new java.awt.Dimension(900, 600));
aFrame.setSize(new Dimension(900, 600));
aFrame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
aFrame.setVisible(true);
}
示例7: generateDiagram
import org.jfree.chart.renderer.xy.XYBarRenderer; //导入方法依赖的package包/类
private static void generateDiagram(long[] results2, int bins) {
double[] buffer = new double[results2.length];
for (int i = 0; i < results2.length; i++)
buffer[i] = results2[i];
// The histogram takes an array
HistogramDataset histo = new HistogramDataset();
histo.addSeries("Relative Occurence of Duration", buffer, bins);
//histo.setType(HistogramType.RELATIVE_FREQUENCY);
histo.setType(HistogramType.SCALE_AREA_TO_1);
JFrame aFrame = new JFrame("Time analysis");
//ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
JFreeChart chart = ChartFactory.createHistogram("Distribution of simulated workflow duration",
"Duration of Workflow execution in ms", "Relative occurence", histo, PlotOrientation.VERTICAL, true, true, false);
// to save as JPG
XYPlot plot = (XYPlot) chart.getPlot();
XYBarRenderer renderer = (XYBarRenderer) plot.getRenderer();
renderer.setDrawBarOutline(false);
renderer.setSeriesOutlinePaint(0, Color.red);
//plot.getRangeAxis().setRange(0, 0.2);
//plot.getDomainAxis().setRange(0, 30);
plot.getRangeAxis().setTickLabelFont(new Font("Arial", 0, 30));
plot.getDomainAxis().setTickLabelFont(new Font("Arial", 0, 30));
plot.getRangeAxis().setLabelFont(new Font("Arial", 1, 28));
plot.getDomainAxis().setLabelFont(new Font("Arial", 1, 28));
//plot.getLegendItems().get(0).set(new Font("Arial", 1, 26));
//plot.getLegendItems().get(1).setLabelFont(new Font("Arial", 1, 24));
LegendTitle legend = chart.getLegend();
Font nwfont = new Font("Arial", 0, 26);
legend.setItemFont(nwfont);
//chart.setLegend(legend);
ChartPanel panel = new ChartPanel(chart);
panel.setPreferredSize(new java.awt.Dimension(800, 600));
aFrame.setContentPane(panel);
aFrame.setPreferredSize(new java.awt.Dimension(800, 600));
aFrame.setSize(new Dimension(800, 600));
aFrame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
aFrame.setVisible(true);
}