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


Java XYBarRenderer.setBarPainter方法代碼示例

本文整理匯總了Java中org.jfree.chart.renderer.xy.XYBarRenderer.setBarPainter方法的典型用法代碼示例。如果您正苦於以下問題:Java XYBarRenderer.setBarPainter方法的具體用法?Java XYBarRenderer.setBarPainter怎麽用?Java XYBarRenderer.setBarPainter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.jfree.chart.renderer.xy.XYBarRenderer的用法示例。


在下文中一共展示了XYBarRenderer.setBarPainter方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createHistogramChart

import org.jfree.chart.renderer.xy.XYBarRenderer; //導入方法依賴的package包/類
/**
 * Creates the histogram chart.
 *
 * @param exampleSet
 * @return
 */
private JFreeChart createHistogramChart(final ExampleSet exampleSet) {
	JFreeChart chart = ChartFactory.createHistogram(null, null, null, createHistogramDataset(exampleSet),
			PlotOrientation.VERTICAL, false, false, false);
	AbstractAttributeStatisticsModel.setDefaultChartFonts(chart);
	chart.setBackgroundPaint(null);
	chart.setBackgroundImageAlpha(0.0f);

	XYPlot plot = (XYPlot) chart.getPlot();
	plot.setRangeGridlinesVisible(false);
	plot.setDomainGridlinesVisible(false);
	plot.setOutlineVisible(false);
	plot.setRangeZeroBaselineVisible(false);
	plot.setDomainZeroBaselineVisible(false);
	plot.getDomainAxis().setTickLabelsVisible(false);
	plot.setBackgroundPaint(COLOR_INVISIBLE);
	plot.setBackgroundImageAlpha(0.0f);

	XYBarRenderer renderer = (XYBarRenderer) plot.getRenderer();
	renderer.setSeriesPaint(0, AttributeGuiTools.getColorForValueType(Ontology.DATE_TIME));
	renderer.setBarPainter(new StandardXYBarPainter());
	renderer.setDrawBarOutline(true);
	renderer.setShadowVisible(false);

	return chart;
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:32,代碼來源:DateTimeAttributeStatisticsModel.java

示例2: createHistogramChart

import org.jfree.chart.renderer.xy.XYBarRenderer; //導入方法依賴的package包/類
/**
 * Creates the histogram chart.
 *
 * @param exampleSet
 * @return
 */
private JFreeChart createHistogramChart(ExampleSet exampleSet) {
	JFreeChart chart = ChartFactory.createHistogram(null, null, null, createHistogramDataset(exampleSet),
			PlotOrientation.VERTICAL, false, false, false);
	AbstractAttributeStatisticsModel.setDefaultChartFonts(chart);
	chart.setBackgroundPaint(null);
	chart.setBackgroundImageAlpha(0.0f);

	XYPlot plot = (XYPlot) chart.getPlot();
	plot.setRangeGridlinesVisible(false);
	plot.setDomainGridlinesVisible(false);
	plot.setOutlineVisible(false);
	plot.setRangeZeroBaselineVisible(false);
	plot.setDomainZeroBaselineVisible(false);
	plot.setBackgroundPaint(COLOR_INVISIBLE);
	plot.setBackgroundImageAlpha(0.0f);

	XYBarRenderer renderer = (XYBarRenderer) plot.getRenderer();
	renderer.setSeriesPaint(0, AttributeGuiTools.getColorForValueType(Ontology.NUMERICAL));
	renderer.setBarPainter(new StandardXYBarPainter());
	renderer.setDrawBarOutline(true);
	renderer.setShadowVisible(false);

	return chart;
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:31,代碼來源:NumericalAttributeStatisticsModel.java

示例3: copyNumberPDF

import org.jfree.chart.renderer.xy.XYBarRenderer; //導入方法依賴的package包/類
@NotNull
static JFreeChart copyNumberPDF(@NotNull final List<PurpleCopyNumber> copyNumbers) {
    final XYDataset dataset = ploidyPDF(copyNumbers, PurpleCopyNumber::averageTumorCopyNumber, PurpleCopyNumber::bafCount);
    JFreeChart chart =
            ChartFactory.createScatterPlot("Copy Number PDF", "Ploidy", "BAF Count", dataset, PlotOrientation.VERTICAL, false, false,
                    false);

    XYBarRenderer renderer = new XYBarRenderer(0.9);
    renderer.setShadowVisible(false);
    renderer.setBarPainter(new StandardXYBarPainter());
    renderer.setSeriesPaint(0, Color.BLUE);

    XYPlot xyPlot = (XYPlot) chart.getPlot();
    xyPlot.getDomainAxis().setRange(0, 10);
    xyPlot.setRenderer(renderer);
    return chart;
}
 
開發者ID:hartwigmedical,項目名稱:hmftools,代碼行數:18,代碼來源:CopyNumberCharts.java

示例4: applyToXYItemRenderer

import org.jfree.chart.renderer.xy.XYBarRenderer; //導入方法依賴的package包/類
/**
 * Applies the settings of this theme to the specified renderer.
 *
 * @param renderer  the renderer (<code>null</code> not permitted).
 */
protected void applyToXYItemRenderer(XYItemRenderer renderer) {
    if (renderer == null) {
        throw new IllegalArgumentException("Null 'renderer' argument.");
    }
    if (renderer instanceof AbstractRenderer) {
        applyToAbstractRenderer((AbstractRenderer) renderer);
    }
    renderer.setBaseItemLabelFont(this.regularFont);
    renderer.setBaseItemLabelPaint(this.itemLabelPaint);
    if (renderer instanceof XYBarRenderer) {
        XYBarRenderer br = (XYBarRenderer) renderer;
        br.setBarPainter(this.xyBarPainter);
        br.setShadowVisible(this.shadowVisible);
    }
}
 
開發者ID:SOCR,項目名稱:HTML5_WebSite,代碼行數:21,代碼來源:StandardChartTheme.java

示例5: 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);
}
 
開發者ID:imagej,項目名稱:imagej-ui-swing,代碼行數:19,代碼來源:SwingHistogramWidget.java

示例6: 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;
}
 
開發者ID:fiji,項目名稱:SPIM_Registration,代碼行數:27,代碼來源:Histogram.java

示例7: 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);
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:32,代碼來源:ChartRendererFactory.java

示例8: applyToXYItemRenderer

import org.jfree.chart.renderer.xy.XYBarRenderer; //導入方法依賴的package包/類
/**
 * Applies the settings of this theme to the specified renderer.
 *
 * @param renderer  the renderer (<code>null</code> not permitted).
 */
protected void applyToXYItemRenderer(XYItemRenderer renderer) {
    ParamChecks.nullNotPermitted(renderer, "renderer");
    if (renderer instanceof AbstractRenderer) {
        applyToAbstractRenderer((AbstractRenderer) renderer);
    }
    renderer.setBaseItemLabelFont(this.regularFont);
    renderer.setBaseItemLabelPaint(this.itemLabelPaint);
    if (renderer instanceof XYBarRenderer) {
        XYBarRenderer br = (XYBarRenderer) renderer;
        br.setBarPainter(this.xyBarPainter);
        br.setShadowVisible(this.shadowVisible);
    }
}
 
開發者ID:mdzio,項目名稱:ccu-historian,代碼行數:19,代碼來源:StandardChartTheme.java

示例9: applyToXYItemRenderer

import org.jfree.chart.renderer.xy.XYBarRenderer; //導入方法依賴的package包/類
/**
 * Applies the settings of this theme to the specified renderer.
 *
 * @param renderer  the renderer ({@code null} not permitted).
 */
protected void applyToXYItemRenderer(XYItemRenderer renderer) {
    Args.nullNotPermitted(renderer, "renderer");
    if (renderer instanceof AbstractRenderer) {
        applyToAbstractRenderer((AbstractRenderer) renderer);
    }
    renderer.setDefaultItemLabelFont(this.regularFont);
    renderer.setDefaultItemLabelPaint(this.itemLabelPaint);
    if (renderer instanceof XYBarRenderer) {
        XYBarRenderer br = (XYBarRenderer) renderer;
        br.setBarPainter(this.xyBarPainter);
        br.setShadowVisible(this.shadowVisible);
    }
}
 
開發者ID:jfree,項目名稱:jfreechart,代碼行數:19,代碼來源:StandardChartTheme.java

示例10: init

import org.jfree.chart.renderer.xy.XYBarRenderer; //導入方法依賴的package包/類
@Override
public void init(ProcessContext ctx) throws Exception {
    super.init(ctx);

    dataset = new SimpleHistogramDataset(key);

    chart = ChartFactory.createHistogram(
            title,
            key,
            "#",
            dataset,
            PlotOrientation.VERTICAL,
            true,
            true,
            false
    );

    chart.setBackgroundPaint(new Color(230, 230, 230));
    XYPlot xyplot = (XYPlot) chart.getPlot();
    if (logAxis)
        xyplot.setRangeAxis(new LogarithmicAxis("#"));

    chart.setTitle(title);
    xyplot.setForegroundAlpha(0.7F);
    xyplot.setBackgroundPaint(Color.WHITE);
    xyplot.setDomainGridlinePaint(new Color(150, 150, 150));
    xyplot.setRangeGridlinePaint(new Color(150, 150, 150));
    XYBarRenderer xybarrenderer = (XYBarRenderer) xyplot.getRenderer();
    xybarrenderer.setShadowVisible(false);
    xybarrenderer.setBarPainter(new StandardXYBarPainter());
    //	    xybarrenderer.setDrawBarOutline(false);

    final ChartPanel chartPanel = new ChartPanel(chart);
    frame = new JFrame();
    frame.getContentPane().setLayout(new BorderLayout());
    frame.getContentPane().add(chartPanel, BorderLayout.CENTER);
    frame.setSize(width, height);
    frame.setVisible(true);
}
 
開發者ID:fact-project,項目名稱:fact-tools,代碼行數:40,代碼來源:HistogramArrayPlotter.java

示例11: createHist

import org.jfree.chart.renderer.xy.XYBarRenderer; //導入方法依賴的package包/類
/**
 * Create Histogram chart.
 *
 * @param table
 *            table to use for chart
 * @param column
 *            column from table that should be used
 * @param bin
 *            the amount of bins to use
 * @return chart
 */
public static JFreeChart createHist(final Table table, final String column,
		final int bin) {
	final String xName = "Plotted column: " + column;
	final String yName = "";
	final double margin = 0.20;

	HistogramDataset dataSet = createDataset(table, column, bin);

	final CategoryAxis xAxis = new CategoryAxis(xName);
	xAxis.setLowerMargin(margin);
	xAxis.setUpperMargin(margin);
	final NumberAxis yAxis = new NumberAxis(yName);
	yAxis.setAutoRangeIncludesZero(false);

	JFreeChart chart = makeChart(dataSet, column);

	final int gridIn = 150;

	XYPlot xyplot = (XYPlot) chart.getPlot();
	xyplot.setBackgroundPaint(Color.WHITE);
	xyplot.setDomainGridlinePaint(new Color(gridIn, gridIn, gridIn));
	xyplot.setRangeGridlinePaint(new Color(gridIn, gridIn, gridIn));

	XYBarRenderer renderer = (XYBarRenderer) xyplot.getRenderer();
	renderer.setDrawBarOutline(true);
	renderer.setShadowVisible(false);
	renderer.setBarPainter(new StandardXYBarPainter());
	renderer.setShadowVisible(false);

	return chart;
}
 
開發者ID:adamIqbal,項目名稱:Health,代碼行數:43,代碼來源:Histogram.java

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

示例13: getHistogramPlotPanel

import org.jfree.chart.renderer.xy.XYBarRenderer; //導入方法依賴的package包/類
private static ChartPanel getHistogramPlotPanel(XIntervalSeriesCollection dataset, String xAxisLabel, String yAxisLabel, Color color) {
        JFreeChart chart = ChartFactory.createHistogram(
                null,
                xAxisLabel,
                yAxisLabel,
                dataset,
                PlotOrientation.VERTICAL,
                false,  // Legend?
                true,   // tooltips
                false   // url
        );
        final XYPlot xyPlot = chart.getXYPlot();
        //xyPlot.setForegroundAlpha(0.85f);
        xyPlot.setNoDataMessage("No data");
        xyPlot.setAxisOffset(new RectangleInsets(5, 5, 5, 5));

        final XYBarRenderer renderer = (XYBarRenderer) xyPlot.getRenderer();
        renderer.setDrawBarOutline(false);
        renderer.setShadowVisible(false);
        renderer.setSeriesPaint(0, color);
        StandardXYBarPainter painter = new StandardXYBarPainter();
        renderer.setBarPainter(painter);

        ChartPanel chartPanel = new ChartPanel(chart);
        chartPanel.setPreferredSize(new Dimension(300, 200));
//        chartPanel.getPopupMenu().add(createCopyDataToClipboardMenuItem());
        return chartPanel;
    }
 
開發者ID:senbox-org,項目名稱:snap-desktop,代碼行數:29,代碼來源:StatisticsPanel.java

示例14: createUI

import org.jfree.chart.renderer.xy.XYBarRenderer; //導入方法依賴的package包/類
private void createUI() {
    dataset = new XIntervalSeriesCollection();
    chart = ChartFactory.createHistogram(
            CHART_TITLE,
            "Values",
            "Frequency in #pixels",
            dataset,
            PlotOrientation.VERTICAL,
            false,  // Legend?
            true,   // tooltips
            false   // url
    );
    final XYPlot xyPlot = chart.getXYPlot();
    xyPlot.setDomainZeroBaselineStroke(new BasicStroke(0.2f));

    final XYBarRenderer renderer = (XYBarRenderer) xyPlot.getRenderer();
    renderer.setDrawBarOutline(false);
    renderer.setShadowVisible(false);
    renderer.setShadowYOffset(-4.0);
    renderer.setBaseToolTipGenerator(new XYPlotToolTipGenerator());
    renderer.setBarPainter(new StandardXYBarPainter());
    renderer.setSeriesPaint(0, new Color(0, 0, 200));

    createUI(createChartPanel(chart), createOptionsPanel(), bindingContext);

    isInitialized = true;

    final Binding minBinding = xAxisRangeControl.getBindingContext().getBinding("min");
    final double min = (Double) minBinding.getPropertyValue();
    final Binding maxBinding = xAxisRangeControl.getBindingContext().getBinding("max");
    final double max = (Double) maxBinding.getPropertyValue();
    if (!histogramComputing && min > max) {
        minBinding.setPropertyValue(max);
        maxBinding.setPropertyValue(min);
    }
    updateXAxis();
}
 
開發者ID:senbox-org,項目名稱:snap-desktop,代碼行數:38,代碼來源:HistogramPanel.java

示例15: 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);
}
 
開發者ID:rapidminer,項目名稱:rapidminer-5,代碼行數:31,代碼來源:ChartRendererFactory.java


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