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


Java StandardBarPainter類代碼示例

本文整理匯總了Java中org.jfree.chart.renderer.category.StandardBarPainter的典型用法代碼示例。如果您正苦於以下問題:Java StandardBarPainter類的具體用法?Java StandardBarPainter怎麽用?Java StandardBarPainter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: configureBarRenderer

import org.jfree.chart.renderer.category.StandardBarPainter; //導入依賴的package包/類
private static void configureBarRenderer(BarRenderer renderer, ValueSource valueSource, PlotInstance plotInstance) {
	StandardBarPainter barPainter = new StandardBarPainter();
	renderer.setBarPainter(barPainter);
	renderer.setGradientPaintTransformer(null);

	ValueSourceData valueSourceData = plotInstance.getPlotData().getValueSourceData(valueSource);
	int seriesCount = valueSourceData.getSeriesCount();
	DimensionConfig domainConfig = valueSource.getDomainConfig();
	DimensionConfig colorDimensionConfig = plotInstance.getCurrentPlotConfigurationClone().getDimensionConfig(
			PlotDimension.COLOR);
	SeriesFormat seriesFormat = valueSource.getSeriesFormat();

	// 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,代碼行數:27,代碼來源:ChartRendererFactory.java

示例2: createBarChart

import org.jfree.chart.renderer.category.StandardBarPainter; //導入依賴的package包/類
/**
 * Creates the histogram chart.
 * 
 * @return
 */
private JFreeChart createBarChart() {
	JFreeChart chart = ChartFactory.createBarChart(null, null, null, createBarDataset(), PlotOrientation.VERTICAL,
			false, false, false);
	AbstractAttributeStatisticsModel.setDefaultChartFonts(chart);
	chart.setBackgroundPaint(null);
	chart.setBackgroundImageAlpha(0.0f);

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

	BarRenderer renderer = (BarRenderer) plot.getRenderer();
	renderer.setSeriesPaint(0, AttributeGuiTools.getColorForValueType(Ontology.NOMINAL));
	renderer.setBarPainter(new StandardBarPainter());
	renderer.setDrawBarOutline(true);
	renderer.setShadowVisible(false);

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

示例3: setChartTheme

import org.jfree.chart.renderer.category.StandardBarPainter; //導入依賴的package包/類
/**
 * Sets the current chart theme.  This will be applied to all new charts
 * created via methods in this class.
 *
 * @param theme  the theme (<code>null</code> not permitted).
 *
 * @see #getChartTheme()
 * @see ChartUtilities#applyCurrentTheme(JFreeChart)
 *
 * @since 1.0.11
 */
public static void setChartTheme(ChartTheme theme) {
    ParamChecks.nullNotPermitted(theme, "theme");
    currentTheme = theme;

    // here we do a check to see if the user is installing the "Legacy"
    // theme, and reset the bar painters in that case...
    if (theme instanceof StandardChartTheme) {
        StandardChartTheme sct = (StandardChartTheme) theme;
        if (sct.getName().equals("Legacy")) {
            BarRenderer.setDefaultBarPainter(new StandardBarPainter());
            XYBarRenderer.setDefaultBarPainter(new StandardXYBarPainter());
        }
        else {
            BarRenderer.setDefaultBarPainter(new GradientBarPainter());
            XYBarRenderer.setDefaultBarPainter(new GradientXYBarPainter());
        }
    }
}
 
開發者ID:mdzio,項目名稱:ccu-historian,代碼行數:30,代碼來源:ChartFactory.java

示例4: setChartTheme

import org.jfree.chart.renderer.category.StandardBarPainter; //導入依賴的package包/類
/**
 * Sets the current chart theme.  This will be applied to all new charts
 * created via methods in this class.
 *
 * @param theme  the theme ({@code null} not permitted).
 *
 * @see #getChartTheme()
 * @see ChartUtils#applyCurrentTheme(JFreeChart)
 *
 * @since 1.0.11
 */
public static void setChartTheme(ChartTheme theme) {
    Args.nullNotPermitted(theme, "theme");
    currentTheme = theme;

    // here we do a check to see if the user is installing the "Legacy"
    // theme, and reset the bar painters in that case...
    if (theme instanceof StandardChartTheme) {
        StandardChartTheme sct = (StandardChartTheme) theme;
        if (sct.getName().equals("Legacy")) {
            BarRenderer.setDefaultBarPainter(new StandardBarPainter());
            XYBarRenderer.setDefaultBarPainter(new StandardXYBarPainter());
        }
        else {
            BarRenderer.setDefaultBarPainter(new GradientBarPainter());
            XYBarRenderer.setDefaultBarPainter(new GradientXYBarPainter());
        }
    }
}
 
開發者ID:jfree,項目名稱:jfreechart,代碼行數:30,代碼來源:ChartFactory.java

示例5: applyTo

import org.jfree.chart.renderer.category.StandardBarPainter; //導入依賴的package包/類
/**
 * Apply the chart style to the chart passed as parameter.
 *
 * @param chart the chart to apply the style to (is modified by the method)
 * @param dataset the dataset associated with the chart
 */
public void applyTo(JFreeChart chart, final DefaultCategoryDataset dataset) {
    CategoryPlot plot = (CategoryPlot) chart.getPlot();
    BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setBarPainter(new StandardBarPainter());
    renderer.setDrawBarOutline(false);
    renderer.setShadowVisible(false);
    int seriesCount = dataset.getRowCount();
    int coloursSize = colours.size();
    int colourMod;
    for (int series = 0; series < seriesCount; series++) {
        colourMod = series % coloursSize;
        renderer.setSeriesPaint(series, this.colours.get(colourMod));
    }

}
 
開發者ID:c2mon,項目名稱:c2mon-web-ui,代碼行數:22,代碼來源:BarChartStyle.java

示例6: GraphData

import org.jfree.chart.renderer.category.StandardBarPainter; //導入依賴的package包/類
public GraphData(String printer_id, String outDir, boolean warn, String label,String yLabel, ArrayList<String> learnSpecs) {
	this.outDir = outDir;
	this.printer_id = printer_id;
	this.warn = warn;
	this.learnSpecs = learnSpecs;
	graphProbs = new ArrayList<String>();
	probGraphed = new LinkedList<GraphProbs>();
	chart = ChartFactory.createBarChart(label, "", yLabel, new DefaultCategoryDataset(), PlotOrientation.VERTICAL, true, true, false);
	applyChartTheme();
	((BarRenderer) chart.getCategoryPlot().getRenderer()).setBarPainter(new StandardBarPainter());
	chart.setBackgroundPaint(new java.awt.Color(238, 238, 238));
	chart.getPlot().setBackgroundPaint(java.awt.Color.WHITE);
	chart.getCategoryPlot().setRangeGridlinePaint(java.awt.Color.LIGHT_GRAY);
	legend = chart.getLegend();
	timeSeriesPlot = false;
	averageOrder = null;
}
 
開發者ID:MyersResearchGroup,項目名稱:iBioSim,代碼行數:18,代碼來源:GraphData.java

示例7: initializeTheme

import org.jfree.chart.renderer.category.StandardBarPainter; //導入依賴的package包/類
public static StandardChartTheme initializeTheme() {
    String fontName = "Arial";
    StandardChartTheme theme = (StandardChartTheme) org.jfree.chart.StandardChartTheme.createJFreeTheme();
    theme.setExtraLargeFont(new Font(fontName, Font.PLAIN, 24)); // title
    theme.setLargeFont(new Font(fontName, Font.PLAIN, 20)); // axis-title
    theme.setRegularFont(new Font(fontName, Font.PLAIN, 16));
    theme.setSmallFont(new Font(fontName, Font.PLAIN, 12));
    theme.setRangeGridlinePaint(Color.decode("#C0C0C0"));
    theme.setPlotBackgroundPaint(Color.white);
    theme.setChartBackgroundPaint(Color.white);
    theme.setGridBandPaint(Color.red);
    theme.setAxisOffset(new RectangleInsets(0, 0, 0, 0));
    theme.setBarPainter(new StandardBarPainter());
    theme.setAxisLabelPaint(Color.decode("#666666"));
    return theme;
}
 
開發者ID:OWASP,項目名稱:Benchmark,代碼行數:17,代碼來源:ScatterPlot.java

示例8: setChartTheme

import org.jfree.chart.renderer.category.StandardBarPainter; //導入依賴的package包/類
/**
 * Sets the current chart theme.  This will be applied to all new charts
 * created via methods in this class.
 *
 * @param theme  the theme (<code>null</code> not permitted).
 *
 * @see #getChartTheme()
 * @see ChartUtilities#applyCurrentTheme(JFreeChart)
 *
 * @since 1.0.11
 */
public static void setChartTheme(ChartTheme theme) {
    if (theme == null) {
        throw new IllegalArgumentException("Null 'theme' argument.");
    }
    currentTheme = theme;

    // here we do a check to see if the user is installing the "Legacy"
    // theme, and reset the bar painters in that case...
    if (theme instanceof StandardChartTheme) {
        StandardChartTheme sct = (StandardChartTheme) theme;
        if (sct.getName().equals("Legacy")) {
            BarRenderer.setDefaultBarPainter(new StandardBarPainter());
            XYBarRenderer.setDefaultBarPainter(new StandardXYBarPainter());
        }
        else {
            BarRenderer.setDefaultBarPainter(new GradientBarPainter());
            XYBarRenderer.setDefaultBarPainter(new GradientXYBarPainter());
        }
    }
}
 
開發者ID:lulab,項目名稱:PI,代碼行數:32,代碼來源:ChartFactory.java

示例9: enableFlatLook

import org.jfree.chart.renderer.category.StandardBarPainter; //導入依賴的package包/類
public static void enableFlatLook(final boolean flat) {
	if (flat) {
		BarRenderer.setDefaultBarPainter(new StandardBarPainter());
		BarRenderer.setDefaultShadowsVisible(false);
		XYBarRenderer.setDefaultBarPainter(new StandardXYBarPainter());
		XYBarRenderer.setDefaultShadowsVisible(false);
		StackedBarRenderer.setDefaultBarPainter(new StandardBarPainter());
		StackedBarRenderer.setDefaultShadowsVisible(false);
	} else {
		BarRenderer.setDefaultBarPainter(new GradientBarPainter());
		BarRenderer.setDefaultShadowsVisible(true);
		XYBarRenderer.setDefaultBarPainter(new GradientXYBarPainter());
		XYBarRenderer.setDefaultShadowsVisible(true);
		StackedBarRenderer.setDefaultBarPainter(new GradientBarPainter());
		StackedBarRenderer.setDefaultShadowsVisible(true);
	}
}
 
開發者ID:gama-platform,項目名稱:gama,代碼行數:18,代碼來源:ChartJFreeChartOutputHistogram.java

示例10: configureBarRenderer

import org.jfree.chart.renderer.category.StandardBarPainter; //導入依賴的package包/類
private void configureBarRenderer(BarRenderer barRenderer) {
    barRenderer.setBarPainter(new StandardBarPainter());
    barRenderer.setSeriesPaint(0, Color.black);
    barRenderer.setSeriesPaint(1, Color.blue);
    barRenderer.setSeriesPaint(2, Color.cyan);
    barRenderer.setSeriesPaint(3, Color.darkGray);
    barRenderer.setSeriesPaint(4, Color.gray);
    barRenderer.setSeriesPaint(5, Color.green);
    barRenderer.setSeriesPaint(6, Color.lightGray);
    barRenderer.setSeriesPaint(7, Color.magenta);
    barRenderer.setSeriesPaint(8, Color.orange);
    barRenderer.setSeriesPaint(9, Color.red);
    barRenderer.setDrawBarOutline(false);
    barRenderer.setShadowVisible(false);
    barRenderer.setBaseItemLabelGenerator(sectorProfileLabelGenerator);
    barRenderer.setBaseItemLabelsVisible(true);
}
 
開發者ID:objektwerks,項目名稱:swing,代碼行數:18,代碼來源:SectorProfileChartPanel.java

示例11: customizeRenderer

import org.jfree.chart.renderer.category.StandardBarPainter; //導入依賴的package包/類
/** Customize renderer. */
private void customizeRenderer(CategoryPlot plot) {
	BarRenderer renderer = (BarRenderer) plot.getRenderer();
	renderer.setMaximumBarWidth(0.5);
	renderer.setSeriesPaint(0, Color.BLACK);

	renderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator());
	renderer.setBaseItemLabelsVisible(true);
	renderer.setBaseItemLabelPaint(Color.white);
	renderer.setBasePositiveItemLabelPosition(new ItemLabelPosition(
			ItemLabelAnchor.CENTER, TextAnchor.CENTER, TextAnchor.CENTER,
			0.0));

	renderer.setBarPainter(new StandardBarPainter());
	renderer.setShadowVisible(false);
}
 
開發者ID:vimaier,項目名稱:conqat,代碼行數:17,代碼來源:BulletChartCreator.java

示例12: createLocationFormatChart

import org.jfree.chart.renderer.category.StandardBarPainter; //導入依賴的package包/類
/**
 * Creates chart (JFreeChart object) from dataset. Is used when Chart Type "Location-Format" or "Format-Location" is selected.
 * 
 * @param collection Collection that provides all data that should be displayed.
 * @param unit Unit: kWh or kWh/TNF
 * @return Returns finished JFreeChart object.
 */
private JFreeChart createLocationFormatChart(DefaultCategoryDataset collection,String unit){

	JFreeChart barChart = ChartFactory.createBarChart("Production Consumption","",
			("1".equals(unit)?"Energy Consumption [kWh]":("2".equals(unit)?"Energy Consumption [kWh/TNF]":("3".equals(unit)?"Produced Pieces [TNF]":""))),
			collection, PlotOrientation.VERTICAL, true, true, false);

	//graphical modifications for BarChart
	barChart.setBackgroundPaint(Color.white);
	CategoryPlot plot = barChart.getCategoryPlot();
	plot.setBackgroundPaint(Color.white);
	plot.setDomainGridlinePaint(Color.white);
	plot.setRangeGridlinePaint(Color.white);
	plot.setAxisOffset(new RectangleInsets(0, 0, 0, 0));
	plot.setShadowGenerator(null);

	//Barmodifications
	BarRenderer renderer=(BarRenderer) plot.getRenderer();
	renderer.setBarPainter(new StandardBarPainter());
	renderer.setItemMargin(0);
	renderer.setShadowVisible(false);
	plot.setRenderer(renderer);

	return barChart;

}
 
開發者ID:Jather90,項目名稱:AMOS_proj5,代碼行數:33,代碼來源:ChartRenderer.java

示例13: configureBarRenderer

import org.jfree.chart.renderer.category.StandardBarPainter; //導入依賴的package包/類
private static void configureBarRenderer(BarRenderer renderer, ValueSource valueSource, PlotInstance plotInstance) {
	StandardBarPainter barPainter = new StandardBarPainter();
	renderer.setBarPainter(barPainter);
	renderer.setGradientPaintTransformer(null);

	ValueSourceData valueSourceData = plotInstance.getPlotData().getValueSourceData(valueSource);
	int seriesCount = valueSourceData.getSeriesCount();
	DimensionConfig domainConfig = valueSource.getDomainConfig();
	DimensionConfig colorDimensionConfig = plotInstance.getCurrentPlotConfigurationClone().getDimensionConfig(PlotDimension.COLOR);
	SeriesFormat seriesFormat = valueSource.getSeriesFormat();

	// 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,代碼行數:26,代碼來源:ChartRendererFactory.java

示例14: createChart

import org.jfree.chart.renderer.category.StandardBarPainter; //導入依賴的package包/類
public Drawable createChart(ADCDataset dataset) {
  final JFreeChart chart = ChartFactory.createBarChart(
      dataset.get(Attribute.TITLE),
      dataset.get(Attribute.X_AXIS_LABEL),
      dataset.get(Attribute.Y_AXIS_LABEL),
      dataset,
      PlotOrientation.VERTICAL,
      true, false, false);
  final CategoryPlot plot = chart.getCategoryPlot();
  plot.setBackgroundPaint(Color.white);
  plot.setDomainGridlinePaint(Color.lightGray);
  plot.setRangeGridlinePaint(Color.lightGray);
  ValueAxis raxis = plot.getRangeAxis();
  raxis.setRange(0, 100.0);
  CategoryAxis cAxis = plot.getDomainAxis();
  cAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_45);
  BarRenderer renderer = (BarRenderer)plot.getRenderer();
  renderer.setSeriesPaint(0, Colors.fromHex("#0AA1D8"));
  renderer.setSeriesPaint(1, Colors.fromHex("#932832"));
  renderer.setSeriesPaint(2, Colors.fromHex("#94BA4D"));
  renderer.setBarPainter(new StandardBarPainter());
  renderer.setItemMargin(0.01);
  return new JFreeChartDrawable(chart, new Dimension(750, 500));
}
 
開發者ID:uq-eresearch,項目名稱:aorra,代碼行數:25,代碼來源:MarineBarChart.java

示例15: createChart

import org.jfree.chart.renderer.category.StandardBarPainter; //導入依賴的package包/類
public static Drawable createChart(ADCDataset dataset, Dimension dimension) {
    final JFreeChart chart = ChartFactory.createBarChart(
            dataset.get(Attribute.TITLE),// chart title
            dataset.get(Attribute.X_AXIS_LABEL),// domain axis label
            dataset.get(Attribute.Y_AXIS_LABEL),// range axis label
            dataset,                  // data
            PlotOrientation.VERTICAL, // orientation
            true,                    // include legend
            false,                     // tooltips?
            false                     // URLs?
        );
    chart.setBackgroundPaint(Color.white);
    final CategoryPlot plot = chart.getCategoryPlot();
    plot.setBackgroundPaint(Color.white);
    plot.setDomainGridlinePaint(Color.lightGray);
    plot.setRangeGridlinePaint(Color.lightGray);
    final BarRenderer renderer = (BarRenderer)plot.getRenderer();
    Colors.setSeriesPaint(renderer, dataset.get(Attribute.SERIES_COLORS));
    renderer.setItemMargin(0);
    renderer.setBarPainter(new StandardBarPainter());
    final CategoryAxis cAxis = plot.getDomainAxis();
    cAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_45);
    chart.getTitle().setFont(cAxis.getLabelFont());
    chart.getLegend().setMargin(2, 60, 2, 20);
    return new JFreeChartDrawable(chart, dimension);
}
 
開發者ID:uq-eresearch,項目名稱:aorra,代碼行數:27,代碼來源:WetlandsRemaing.java


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