當前位置: 首頁>>代碼示例>>Java>>正文


Java XYBarRenderer.setMargin方法代碼示例

本文整理匯總了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;
}
 
開發者ID:TIBCOSoftware,項目名稱:jasperreports,代碼行數:21,代碼來源:EyeCandySixtiesChartTheme.java

示例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);
}
 
開發者ID:wrbraga,項目名稱:JGrafix,代碼行數:11,代碼來源:EixoVolume.java

示例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;
}
 
開發者ID:Mikescher,項目名稱:jClipCorn,代碼行數:40,代碼來源:StatisticsYearChart.java

示例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));
    
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:50,代碼來源:XYBarRendererTests.java

示例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));
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:62,代碼來源:XYBarRendererTests.java


注:本文中的org.jfree.chart.renderer.xy.XYBarRenderer.setMargin方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。