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


Java XYBarRenderer.setSeriesPaint方法代碼示例

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


在下文中一共展示了XYBarRenderer.setSeriesPaint方法的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: 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

示例5: crearHistograma

import org.jfree.chart.renderer.xy.XYBarRenderer; //導入方法依賴的package包/類
private JFreeChart crearHistograma(IntervalXYDataset datos) {
    JFreeChart jfreechart = ChartFactory.
            createHistogram("Histograma", "X","Y", datos, PlotOrientation.VERTICAL, false, false, false);
            //createHistogram("Histograma", "X","Y", datos, PlotOrientation.VERTICAL, false, false, false);
           //createXYBarChart("Histograma", "X", false, "Y", datos, PlotOrientation.VERTICAL, false, false, false);
           
    //jfreechart.getCategoryPlot();
    jfreechart.getPlot().setOutlinePaint(Color.black);
    XYPlot cp=(XYPlot)jfreechart.getPlot();
    XYBarRenderer renderer=(XYBarRenderer)cp.getRenderer();
    
    cp.setWeight(80);
    
            
    renderer.setSeriesPaint(0,Color.GRAY);
    jfreechart.setAntiAlias(true);
    jfreechart.setBackgroundPaint(Color.white);
   
    return jfreechart;
}
 
開發者ID:dlfinis,項目名稱:PSimulacion,代碼行數:21,代碼來源:dlgGraf.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: 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

示例9: resetUI

import org.jfree.chart.renderer.xy.XYBarRenderer; //導入方法依賴的package包/類
/**
 * Resets the display.
 */
@Override
void resetUI() {
    super.resetUI();
    XYPlot xyPlot = mChart.getXYPlot();
    xyPlot.getRangeAxis().setVisible(false);
    mTooltipGenerator = new CustomXYToolTipGenerator();

    @SuppressWarnings("unchecked")
    List<String>[] mTooltipsTmp = new List[NUM_SERIES];
    mTooltips = mTooltipsTmp;

    XYBarRenderer br = new XYBarRenderer();
    br.setUseYInterval(true);
    mDatasets = new TimePeriodValues[NUM_SERIES];

    TimePeriodValuesCollection tpvc = new YIntervalTimePeriodValuesCollection(1);
    xyPlot.setDataset(tpvc);
    xyPlot.setRenderer(br);

    for (int i = 0; i < NUM_SERIES; i++) {
        br.setSeriesPaint(i, SERIES_COLORS[i]);
        mDatasets[i] = new TimePeriodValues(SERIES_NAMES[i]);
        tpvc.addSeries(mDatasets[i]);
        mTooltips[i] = new ArrayList<String>();
        mTooltipGenerator.addToolTipSeries(mTooltips[i]);
        br.setSeriesToolTipGenerator(i, mTooltipGenerator);
    }
}
 
開發者ID:utds3lab,項目名稱:SMVHunter,代碼行數:32,代碼來源:DisplaySyncPerf.java

示例10: setSeriesColors

import org.jfree.chart.renderer.xy.XYBarRenderer; //導入方法依賴的package包/類
/** Set series colors */
private void setSeriesColors(XYBarRenderer renderer) {
	for (Entry<String, Color> entry : seriesColors.entrySet()) {
		int seriesIndex = taskSeriesCollection.getRowIndex(entry.getKey());

		// If a series name is not found, we silently ignore it. A missing
		// series is not necessarily a configuration error, since it is
		// missing if no data points for it are available.
		if (seriesIndex != -1) {
			renderer.setSeriesPaint(seriesIndex, entry.getValue());
		}
	}
}
 
開發者ID:vimaier,項目名稱:conqat,代碼行數:14,代碼來源:XYGanttChartCreator.java

示例11: 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

示例12: 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

示例13: 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

示例14: 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

示例15: createCombinedChart

import org.jfree.chart.renderer.xy.XYBarRenderer; //導入方法依賴的package包/類
/**
 * Creates an overlaid chart.
 *
 * @return The chart.
 */
private static JFreeChart createCombinedChart() {

    // create plot ...
    IntervalXYDataset data1 = createDataset1();
    XYItemRenderer renderer1 = new XYLineAndShapeRenderer(true, false);
    renderer1.setBaseToolTipGenerator(new StandardXYToolTipGenerator(
            StandardXYToolTipGenerator.DEFAULT_TOOL_TIP_FORMAT,
            new SimpleDateFormat("d-MMM-yyyy"), new DecimalFormat("0.00")));
    renderer1.setSeriesStroke(0, new BasicStroke(4.0f,
            BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL));
    renderer1.setSeriesPaint(0, Color.blue);

    DateAxis domainAxis = new DateAxis("Year");
    domainAxis.setLowerMargin(0.0);
    domainAxis.setUpperMargin(0.02);
    ValueAxis rangeAxis = new NumberAxis("$billion");
    XYPlot plot1 = new XYPlot(data1, null, rangeAxis, renderer1);
    plot1.setBackgroundPaint(Color.lightGray);
    plot1.setDomainGridlinePaint(Color.white);
    plot1.setRangeGridlinePaint(Color.white);

    // add a second dataset and renderer...
    IntervalXYDataset data2 = createDataset2();
    XYBarRenderer renderer2 = new XYBarRenderer() {
        public Paint getItemPaint(int series, int item) {
            XYDataset dataset = getPlot().getDataset();
            if (dataset.getYValue(series, item) >= 0.0) {
                return Color.red;
            }
            else {
                return Color.green;
            }
        }
    };
    renderer2.setSeriesPaint(0, Color.red);
    renderer2.setDrawBarOutline(false);
    renderer2.setBaseToolTipGenerator(new StandardXYToolTipGenerator(
            StandardXYToolTipGenerator.DEFAULT_TOOL_TIP_FORMAT,
            new SimpleDateFormat("d-MMM-yyyy"), new DecimalFormat("0.00")));

    XYPlot plot2 = new XYPlot(data2, null, new NumberAxis("$billion"),
            renderer2);
    plot2.setBackgroundPaint(Color.lightGray);
    plot2.setDomainGridlinePaint(Color.white);
    plot2.setRangeGridlinePaint(Color.white);

    CombinedXYPlot cplot = new CombinedXYPlot(domainAxis, rangeAxis);
    cplot.add(plot1, 3);
    cplot.add(plot2, 2);
    cplot.setGap(8.0);
    cplot.setDomainGridlinePaint(Color.white);
    cplot.setDomainGridlinesVisible(true);

    // return a new chart containing the overlaid plot...
    JFreeChart chart = new JFreeChart("CombinedXYPlotDemo1",
            JFreeChart.DEFAULT_TITLE_FONT, cplot, false);
    chart.setBackgroundPaint(Color.white);
    LegendTitle legend = new LegendTitle(cplot);
    chart.addSubtitle(legend);
    return chart;
}
 
開發者ID:Yarichi,項目名稱:Proyecto-DASI,代碼行數:67,代碼來源:CombinedXYPlotDemo1.java


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