本文整理汇总了Java中org.jfree.chart.renderer.xy.XYBarRenderer.setMargin方法的典型用法代码示例。如果您正苦于以下问题:Java XYBarRenderer.setMargin方法的具体用法?Java XYBarRenderer.setMargin怎么用?Java XYBarRenderer.setMargin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.renderer.xy.XYBarRenderer
的用法示例。
在下文中一共展示了XYBarRenderer.setMargin方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createXYBarChart
import org.jfree.chart.renderer.xy.XYBarRenderer; //导入方法依赖的package包/类
@Override
protected JFreeChart createXYBarChart() throws JRException
{
JFreeChart jfreeChart = super.createXYBarChart();
XYPlot xyPlot = (XYPlot)jfreeChart.getPlot();
XYBarRenderer renderer = (XYBarRenderer)xyPlot.getRenderer();
renderer.setMargin(0.1);
renderer.setGradientPaintTransformer(
new StandardGradientPaintTransformer(GradientPaintTransformType.HORIZONTAL)
);
XYDataset xyDataset = xyPlot.getDataset();
if (xyDataset != null)
{
for (int i = 0; i < xyDataset.getSeriesCount(); i++)
{
renderer.setSeriesPaint(i, ChartThemesConstants.EYE_CANDY_SIXTIES_GRADIENT_PAINTS.get(i));
}
}
return jfreeChart;
}
示例2: completarPlot
import org.jfree.chart.renderer.xy.XYBarRenderer; //导入方法依赖的package包/类
protected void completarPlot(final XYPlot plot, final JanelaGraficos janela) {
IntervalXYDataset dataVolume = criarVolumeDataset(janela);
XYBarRenderer volumeRenderer = new XYBarRenderer();
volumeRenderer.setSeriesPaint(0,Controle.getConfiguracoesUsuario().getCorVolume());
volumeRenderer.setDrawBarOutline(false);
volumeRenderer.setMargin((double)Controle.getConfiguracoesUsuario().getEspacColunasVolume() / 10);
volumeRenderer.setToolTipGenerator(new CandlesToolTipGenerator(janela));
plot.setDataset(indices.size(), dataVolume);
plot.setRenderer(indices.size(), volumeRenderer);
}
示例3: createChart
import org.jfree.chart.renderer.xy.XYBarRenderer; //导入方法依赖的package包/类
@Override
protected JFreeChart createChart(CCMovieList movielist, StatisticsTypeFilter source) {
JFreeChart chart = ChartFactory.createHistogram(
"", //$NON-NLS-1$
"", //$NON-NLS-1$
"", //$NON-NLS-1$
getDataSet(movielist, source),
PlotOrientation.VERTICAL,
false,
false,
false
);
chart.removeLegend();
XYPlot plot = chart.getXYPlot();
XYBarRenderer bar_renderer = (XYBarRenderer) plot.getRenderer();
bar_renderer.setBaseFillPaint(HISTOGRAMMCHART_COLOR);
bar_renderer.setMargin( 0.2 );
bar_renderer.setBarAlignmentFactor( 0 );
bar_renderer.setSeriesPaint(0, HISTOGRAMMCHART_COLOR);
bar_renderer.setShadowVisible(true);
bar_renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator("{1}: {2}", new DecimalFormat("0"), new DecimalFormat("0"))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
bar_renderer.setBarPainter(new StandardXYBarPainter());
plot.setBackgroundPaint(HISTOGRAMMACKGROUND_COLOR);
plot.setDomainGridlinePaint(GRIDLINECOLOR);
plot.setRangeGridlinePaint(GRIDLINECOLOR);
chart.setBackgroundPaint(null);
plot.getDomainAxis().setTickLabelPaint(TEXT_FOREGROUND);
if (plot.getDomainAxis() instanceof NumberAxis) {
((NumberAxis)plot.getDomainAxis()).setNumberFormatOverride(new DecimalFormat("0")); //$NON-NLS-1$
}
plot.getRangeAxis().setTickLabelPaint(TEXT_FOREGROUND);
return chart;
}
示例4: testEquals
import org.jfree.chart.renderer.xy.XYBarRenderer; //导入方法依赖的package包/类
/**
* Test that the equals() method distinguishes all fields.
*/
public void testEquals() {
// default instances
XYBarRenderer r1 = new XYBarRenderer();
XYBarRenderer r2 = new XYBarRenderer();
assertTrue(r1.equals(r2));
assertTrue(r2.equals(r1));
// setBase()
r1.setBase(1.0);
assertFalse(r1.equals(r2));
r2.setBase(1.0);
assertTrue(r1.equals(r2));
// setUseYInterval
r1.setUseYInterval(!r1.getUseYInterval());
assertFalse(r1.equals(r2));
r2.setUseYInterval(!r2.getUseYInterval());
assertTrue(r1.equals(r2));
// setMargin()
r1.setMargin(0.10);
assertFalse(r1.equals(r2));
r2.setMargin(0.10);
assertTrue(r1.equals(r2));
// setDrawBarOutline()
r1.setDrawBarOutline(!r1.isDrawBarOutline());
assertFalse(r1.equals(r2));
r2.setDrawBarOutline(!r2.isDrawBarOutline());
assertTrue(r1.equals(r2));
// setGradientPaintTransformer()
r1.setGradientPaintTransformer(
new StandardGradientPaintTransformer(
GradientPaintTransformType.CENTER_HORIZONTAL
)
);
assertFalse(r1.equals(r2));
r2.setGradientPaintTransformer(
new StandardGradientPaintTransformer(
GradientPaintTransformType.CENTER_HORIZONTAL
)
);
assertTrue(r1.equals(r2));
}
示例5: testEquals
import org.jfree.chart.renderer.xy.XYBarRenderer; //导入方法依赖的package包/类
/**
* Test that the equals() method distinguishes all fields.
*/
public void testEquals() {
// default instances
XYBarRenderer r1 = new XYBarRenderer();
XYBarRenderer r2 = new XYBarRenderer();
assertTrue(r1.equals(r2));
assertTrue(r2.equals(r1));
// setBase()
r1.setBase(1.0);
assertFalse(r1.equals(r2));
r2.setBase(1.0);
assertTrue(r1.equals(r2));
// setUseYInterval
r1.setUseYInterval(!r1.getUseYInterval());
assertFalse(r1.equals(r2));
r2.setUseYInterval(!r2.getUseYInterval());
assertTrue(r1.equals(r2));
// setMargin()
r1.setMargin(0.10);
assertFalse(r1.equals(r2));
r2.setMargin(0.10);
assertTrue(r1.equals(r2));
// setDrawBarOutline()
r1.setDrawBarOutline(!r1.isDrawBarOutline());
assertFalse(r1.equals(r2));
r2.setDrawBarOutline(!r2.isDrawBarOutline());
assertTrue(r1.equals(r2));
// setGradientPaintTransformer()
r1.setGradientPaintTransformer(new StandardGradientPaintTransformer(
GradientPaintTransformType.CENTER_HORIZONTAL));
assertFalse(r1.equals(r2));
r2.setGradientPaintTransformer(new StandardGradientPaintTransformer(
GradientPaintTransformType.CENTER_HORIZONTAL));
assertTrue(r1.equals(r2));
// legendBar
r1.setLegendBar(new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0));
assertFalse(r1.equals(r2));
r2.setLegendBar(new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0));
assertTrue(r1.equals(r2));
// positiveItemLabelFallbackPosition
r1.setPositiveItemLabelPositionFallback(new ItemLabelPosition());
assertFalse(r1.equals(r2));
r2.setPositiveItemLabelPositionFallback(new ItemLabelPosition());
assertTrue(r1.equals(r2));
// negativeItemLabelFallbackPosition
r1.setNegativeItemLabelPositionFallback(new ItemLabelPosition());
assertFalse(r1.equals(r2));
r2.setNegativeItemLabelPositionFallback(new ItemLabelPosition());
assertTrue(r1.equals(r2));
}