Tabnine Logo
BarRenderer
Code IndexAdd Tabnine to your IDE (free)

How to use
BarRenderer
in
org.jfree.chart.renderer.category

Best Java code snippets using org.jfree.chart.renderer.category.BarRenderer (Showing top 20 results out of 315)

Refine searchRefine arrow

  • CategoryPlot
  • JFreeChart
  • CategoryAxis
origin: kiegroup/optaplanner

private BarRenderer createBarChartRenderer(NumberFormat numberFormat) {
  BarRenderer renderer = new BarRenderer();
  ItemLabelPosition positiveItemLabelPosition = new ItemLabelPosition(
      ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER);
  renderer.setBasePositiveItemLabelPosition(positiveItemLabelPosition);
  ItemLabelPosition negativeItemLabelPosition = new ItemLabelPosition(
      ItemLabelAnchor.OUTSIDE6, TextAnchor.TOP_CENTER);
  renderer.setBaseNegativeItemLabelPosition(negativeItemLabelPosition);
  renderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator(
      StandardCategoryItemLabelGenerator.DEFAULT_LABEL_FORMAT_STRING, numberFormat));
  renderer.setBaseItemLabelsVisible(true);
  return renderer;
}
origin: stackoverflow.com

 CategoryPlot categoryPlot = chart.getCategoryPlot();
BarRenderer br = (BarRenderer) categoryPlot.getRenderer();
br.setMaximumBarWidth(.35); // set maximum width to 35% of chart
origin: com.manydesigns/portofino-chart

chart.setAntiAlias(antiAlias);
chart.setBorderVisible(borderVisible);
chart.setBorderPaint(Color.lightGray);
CategoryPlot plot = (CategoryPlot) chart.getPlot();
CategoryItemRenderer renderer = plot.getRenderer();
String urlExpression = chartDefinition.getUrlExpression();
if(!StringUtils.isBlank(urlExpression)) {
  BarRenderer barRenderer = (BarRenderer)renderer;
  barRenderer.setDrawBarOutline(true);
  barRenderer.setShadowVisible(false);
  barRenderer.setBarPainter(new StandardBarPainter());
plot.setBackgroundPaint(transparentColor);
plot.setOutlinePaint(transparentColor);
CategoryAxis categoryAxis = plot.getDomainAxis();
categoryAxis.setAxisLinePaint(Color.BLACK);
categoryAxis.setLabelFont(axisFont);
categoryAxis.setAxisLineVisible(true);
origin: org.jenkins-ci.plugins/vectorcast-coverage

chart.setBackgroundPaint(Color.white);
final CategoryPlot plot = chart.getCategoryPlot();
plot.setBackgroundPaint(Color.WHITE);
plot.setOutlinePaint(null);
plot.setRangeGridlinesVisible(true);
plot.setRangeGridlinePaint(Color.black);
CategoryAxis domainAxis = new ShiftedCategoryAxis(null);
plot.setDomainAxis(domainAxis);
domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
domainAxis.setLowerMargin(0.0);
domainAxis.setUpperMargin(0.0);
domainAxis.setCategoryMargin(0.0);
plot.setRangeAxis(1, axis2);
final BarRenderer renderer2 = new BarRenderer();
Color color = new Color(0xC0, 0xC0, 0xC0, 128);
renderer2.setSeriesPaint(0, color);
plot.setRenderer(1, renderer2);
return chart;
origin: matsim-org/matsim

    false // URLs?
    );
CategoryPlot plot = this.chart_.getCategoryPlot();
plot.getDomainAxis().setCategoryLabelPositions(CategoryLabelPositions.UP_45);
BarRenderer renderer = new BarRenderer();
renderer.setSeriesOutlinePaint(0, Color.black);
renderer.setSeriesOutlinePaint(1, Color.black);
renderer.setSeriesPaint(0, Color.getHSBColor((float) 0.62, (float) 0.56, (float) 0.93));
renderer.setSeriesPaint(1, Color.getHSBColor((float) 0.1, (float) 0.79, (float) 0.89));
renderer.setSeriesToolTipGenerator(0, new StandardCategoryToolTipGenerator());
renderer.setSeriesToolTipGenerator(1, new StandardCategoryToolTipGenerator());
renderer.setItemMargin(0.0);
renderer.setShadowVisible(false);  
renderer.setBarPainter( new StandardBarPainter() ); 
this.chart_.setBackgroundPaint(Color.getHSBColor((float) 0.0, (float) 0.0, (float) 0.93));
plot.setBackgroundPaint(Color.white); 	     
plot.setRangeGridlinePaint(Color.gray);		
plot.setRangeGridlinesVisible(true);      
final CategoryAxis axis1 = plot.getDomainAxis();
axis1.setCategoryMargin(0.25); // leave a gap of 25% between categories
origin: jenkinsci/testng-plugin-plugin

chart.setBackgroundPaint(Color.white);
chart.removeLegend();
final CategoryPlot plot = chart.getCategoryPlot();
plot.setBackgroundPaint(Color.WHITE);
plot.setOutlinePaint(null);
plot.setForegroundAlpha(0.8f);
plot.setDomainGridlinesVisible(true);
plot.setDomainGridlinePaint(Color.white);
plot.setDomainAxis(domainAxis);
domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
domainAxis.setLowerMargin(0.0);
domainAxis.setUpperMargin(0.0);
domainAxis.setCategoryMargin(0.0);
br.setBaseToolTipGenerator(new CategoryToolTipGenerator()
br.setBaseItemURLGenerator(new CategoryURLGenerator()
br.setItemMargin(0.0);
br.setMinimumBarLength(5);
br.setBase(br.findRangeBounds(dataset).getUpperBound() / 100);
plot.setRenderer(br);
origin: org.sakaiproject.sitestats/sitestats-impl

chart.setBackgroundPaint (parseColor (statsManager.getChartBackgroundColor ()));
chart.setPadding (new RectangleInsets (10, 5, 5, 5));
chart.setBorderVisible (true);
chart.setBorderPaint (parseColor ("#cccccc"));
plot.setForegroundAlpha (0.7f);
plot.setAxisOffset (new RectangleInsets (5.0, 5.0, 5.0, 5.0));
plot.setBackgroundPaint (Color.lightGray);
plot.setDomainGridlinesVisible (false);
plot.setRangeGridlinesVisible (true);
CategoryAxis domainAxis = plot.getDomainAxis();
domainAxis.setVisible(false);
domainAxis.setUpperMargin (0);
domainAxis.setLowerMargin (0);
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
  = new StandardCategoryItemLabelGenerator("{1}", 
      NumberFormat.getInstance(new ResourceLoader().getLocale()));
renderer.setBaseItemLabelGenerator(generator);
renderer.setBaseItemLabelFont(new Font("SansSerif", Font.PLAIN, 9));
renderer.setBaseItemLabelsVisible(true);
renderer.setItemMargin (0);
renderer.setSeriesPaint (0, Color.BLUE);
BufferedImage img = chart.createBufferedImage (width, height);
origin: datacleaner/DataCleaner

public static void applyStyles(final JFreeChart chart) {
  final TextTitle title = chart.getTitle();
  if (title != null) {
    title.setFont(WidgetUtils.FONT_HEADER1);
  for (int i = 0; i < chart.getSubtitleCount(); i++) {
    final Title subtitle = chart.getSubtitle(i);
    if (subtitle instanceof TextTitle) {
      ((TextTitle) subtitle).setFont(WidgetUtils.FONT_NORMAL);
    final int columnCount = categoryPlot.getDataset().getColumnCount();
    if (columnCount > 1) {
      categoryPlot.setDomainGridlinesVisible(true);
    } else {
      categoryPlot.setDomainGridlinesVisible(false);
    categoryPlot.setDomainGridlinePaint(WidgetUtils.BG_COLOR_DARK);
    categoryPlot.setDomainGridlinePosition(CategoryAnchor.END);
    categoryPlot.getDomainAxis().setLabelFont(WidgetUtils.FONT_SMALL);
    categoryPlot.getDomainAxis().setTickLabelFont(WidgetUtils.FONT_SMALL);
    categoryPlot.getRangeAxis().setLabelFont(WidgetUtils.FONT_SMALL);
    categoryPlot.getRangeAxis().setTickLabelFont(WidgetUtils.FONT_SMALL);
      barRenderer.setShadowPaint(WidgetUtils.BG_COLOR_BRIGHT);
      barRenderer.setBarPainter(new StandardBarPainter());
origin: org.sakaiproject.sitestats/sitestats-impl

else
  chart = ChartFactory.createBarChart(null, null, null, dataset, PlotOrientation.VERTICAL, true, false, false);
CategoryPlot plot = (CategoryPlot) chart.getPlot();
plot.setForegroundAlpha(transparency);
chart.setBackgroundPaint(parseColor(M_sm.getChartBackgroundColor()));
plot.getDomainAxis().setMaximumCategoryLabelLines(50);
plot.getDomainAxis().setMaximumCategoryLabelWidthRatio(1.0f);
  plot.getDomainAxis().setTickLabelFont(new Font("SansSerif", Font.PLAIN, 8));
  plot.getDomainAxis().setCategoryMargin(0.05);
BarRenderer barrenderer = (BarRenderer) plot.getRenderer();
barrenderer.setDrawBarOutline(true);
if(smallFontInDomainAxis && !canUseNormalFontSize(width)) 
  barrenderer.setItemMargin(0.05);
else
  barrenderer.setItemMargin(0.10);
  plot.getRangeAxis().setUpperMargin(0.2);
  barrenderer.setItemLabelGenerator(new StandardCategoryItemLabelGenerator() {
    private static final long	serialVersionUID	= 1L;
  barrenderer.setItemLabelFont(new Font("SansSerif", Font.PLAIN, 8));
  barrenderer.setItemLabelsVisible(true);
origin: stackoverflow.com

  plot.setBackgroundPaint(Color.lightGray);
  plot.setDomainGridlinePaint(Color.white);
  plot.setRangeGridlinePaint(Color.white);
  final BarRenderer renderer = (BarRenderer) plot.getRenderer();
  renderer.setDrawBarOutline(false);
    0.0f, 0.0f, Color.lightGray
  );
  renderer.setSeriesPaint(0, gp0);
  renderer.setSeriesPaint(1, gp1);
  renderer.setSeriesPaint(2, gp2);
final CategoryAxis domainAxis = plot.getDomainAxis();
domainAxis.setCategoryLabelPositions(
  CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 6.0)
);
origin: stackoverflow.com

chart.setBackgroundPaint(Color.WHITE);
CategoryPlot plot = (CategoryPlot) chart.getPlot();
plot.setBackgroundPaint(new Color(221, 223, 238));
plot.setRangeGridlinePaint(Color.white);
BarRenderer renderer = (BarRenderer) plot.getRenderer();
renderer.setSeriesPaint(0, new Color(231, 175, 61));
renderer.setSeriesPaint(1, Color.green);
renderer.setDrawBarOutline(false);
renderer.setShadowVisible(false);
chart.setBackgroundPaint(Color.WHITE);
chart.getTitle().setPaint(Color.blue);
CategoryPlot p = chart.getCategoryPlot();
origin: jenkinsci/performance-plugin

public static JFreeChart doCreateSummarizerChart(CategoryDataset dataset,
                         String yAxis, String chartTitle) {
  final JFreeChart chart = ChartFactory.createBarChart(chartTitle, // chart
      // title
      null, // unused
      yAxis, // range axis label
      dataset, // data
      PlotOrientation.VERTICAL, // orientation
      true, // include legend
      true, // tooltips
      true // urls
  );
  chart.setBackgroundPaint(Color.WHITE);
  final CategoryPlot plot = chart.getCategoryPlot();
  plot.setBackgroundPaint(Color.WHITE);
  plot.setRangeGridlinesVisible(true);
  plot.setRangeGridlinePaint(Color.BLACK);
  CategoryAxis domainAxis = plot.getDomainAxis();
  domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_45);
  final BarRenderer renderer = (BarRenderer) plot.getRenderer();
  renderer.setDrawBarOutline(false);
  renderer.setBaseStroke(new BasicStroke(4.0f));
  renderer.setItemMargin(0);
  renderer.setMaximumBarWidth(0.05);
  return chart;
}
origin: stackoverflow.com

final CategoryPlot plot = chart.getCategoryPlot();
chart.setBackgroundPaint(Color.white);       
plot.setBackgroundPaint(Color.lightGray);
plot.setDomainGridlinePaint(Color.white);
plot.setRangeGridlinePaint(Color.white);
BarRenderer renderer=new BarRenderer();
renderer = (BarRenderer) plot.getRenderer();
renderer.setDrawBarOutline(false);
renderer.setMaximumBarWidth(0.10);
);
renderer.setSeriesPaint(0, gp0);
renderer.setSeriesPaint(1, gp1);
origin: org.codehaus.jtstand/jtstand-chart

chart.setBackgroundPaint(Color.white);
CategoryPlot plot = (CategoryPlot) chart.getPlot();
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
BarRenderer renderer = (BarRenderer) plot.getRenderer();
renderer.setDrawBarOutline(false);
GradientPaint gp2 = new GradientPaint(0.0f, 0.0f, Color.red,
    0.0f, 0.0f, new Color(64, 0, 0));
renderer.setSeriesPaint(0, gp0);
renderer.setSeriesPaint(1, gp1);
renderer.setSeriesPaint(2, gp2);
CategoryAxis domainAxis = plot.getDomainAxis();
domainAxis.setCategoryLabelPositions(
    CategoryLabelPositions.createUpRotationLabelPositions(
        Math.PI / 6.0));
origin: net.sourceforge.ondex.apps/ovtk2-experimental

CategoryAxis domainAxis = new CategoryAxis();
domainAxis.setTickLabelsVisible(false);
domainAxis.setTickMarksVisible(false);
domainAxis.setAxisLineVisible(true);
domainAxis.setVisible(true);
  renderer = new BarRenderer3D();
else {
  renderer = new BarRenderer();
  ((BarRenderer) renderer)
      .setBarPainter(new StandardBarPainter());
  ((BarRenderer) renderer).setShadowVisible(false);
CategoryPlot plot = new CategoryPlot();
plot.setDataset(dataset);
plot.setDomainAxis(domainAxis);
plot.setDomainGridlinesVisible(false);
plot.setDomainCrosshairVisible(false);
JFreeChart chart = new JFreeChart(null,
    JFreeChart.DEFAULT_TITLE_FONT, plot, false);
chart.setBorderVisible(true);
image = chart.createBufferedImage(width, targMax);
origin: com.atlassian.jira/jira-core

CategoryPlot plot = (CategoryPlot) chart.getPlot();
plot.setAxisOffset(new RectangleInsets(1.0, 1.0, 1.0, 1.0));
BarRenderer renderer = (BarRenderer) plot.getRenderer();
renderer.setBarPainter(new StandardBarPainter());
renderer.setShadowVisible(false);
renderer.setBaseItemLabelFont(ChartDefaults.defaultFont);
renderer.setBaseItemLabelsVisible(false);
renderer.setItemMargin(0.2);
renderer.setBasePositiveItemLabelPosition(
    new ItemLabelPosition(ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER));
renderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator());
renderer.setBaseItemLabelPaint(ChartDefaults.axisLabelColor);
renderer.setBaseToolTipGenerator(generator);
renderer.setDrawBarOutline(false);
for (int j = 0; j < ChartDefaults.darkColors.length; j++)
  renderer.setSeriesPaint(j, ChartDefaults.darkColors[j]);
origin: stackoverflow.com

  "BarChart using JFreeChart", "Student sample", "Marks sample",
  dataset, PlotOrientation.VERTICAL, true, true, false);
chart.setBackgroundPaint(Color.yellow);
chart.getTitle().setPaint(Color.blue);
CategoryPlot plot = chart.getCategoryPlot();
BarRenderer br = (BarRenderer) plot.getRenderer();
br.setItemMargin(0);
CategoryAxis domain = plot.getDomainAxis();
domain.setLowerMargin(0.25);
domain.setUpperMargin(0.25);
origin: webanno/webanno

    PlotOrientation.HORIZONTAL, false, false, false);
CategoryPlot plot = chart.getCategoryPlot();
plot.setOutlineVisible(false);
plot.setBackgroundPaint(null);
plot.setNoDataMessage("No data");
plot.setInsets(new RectangleInsets(UnitType.ABSOLUTE, 0, 20, 0, 20));
if (aMaxValue > 0) {
  plot.getRangeAxis().setVisible(false);
  plot.getDomainAxis().setVisible(false);
BarRenderer renderer = new BarRenderer();
renderer.setBarPainter(new StandardBarPainter());
renderer.setShadowVisible(false);
renderer.setSeriesPaint(0, Color.BLUE);
chart.getCategoryPlot().setRenderer(renderer);
origin: pentaho/pentaho-platform

 barRenderer = new BarRenderer();
 lineRenderer = new LineAndShapeRenderer();
 barRenderer.setPositiveItemLabelPosition( position1 );
 lineRenderer.setPositiveItemLabelPosition( position1 );
 ItemLabelPosition position2 = new ItemLabelPosition( ItemLabelAnchor.OUTSIDE9, TextAnchor.CENTER_RIGHT );
 barRenderer.setNegativeItemLabelPosition( position2 );
 lineRenderer.setNegativeItemLabelPosition( position2 );
} else if ( orientation == PlotOrientation.VERTICAL ) {
 ItemLabelPosition position1 = new ItemLabelPosition( ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER );
 barRenderer.setPositiveItemLabelPosition( position1 );
 lineRenderer.setPositiveItemLabelPosition( position1 );
 ItemLabelPosition position2 = new ItemLabelPosition( ItemLabelAnchor.OUTSIDE6, TextAnchor.TOP_CENTER );
 barRenderer.setNegativeItemLabelPosition( position2 );
 lineRenderer.setNegativeItemLabelPosition( position2 );
 barRenderer.setBaseToolTipGenerator( new StandardCategoryToolTipGenerator() );
 lineRenderer.setBaseToolTipGenerator( new StandardCategoryToolTipGenerator() );
 barRenderer.setBaseItemURLGenerator( new StandardCategoryURLGenerator() );
 lineRenderer.setBaseItemURLGenerator( new StandardCategoryURLGenerator() );
 barRenderer.setMaximumBarWidth( chartDefinition.getMaxBarWidth().doubleValue() );
CategoryPlot plot = new CategoryPlot( barsDataset, catAxis, barsAxis, barRenderer );
plot.setRenderer( 1, lineRenderer );
origin: jasperreports/jasperreports

CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
boolean isShowTickLabels = barPlot.getShowTickLabels() == null ? true : barPlot.getShowTickLabels().booleanValue();
categoryPlot.getDomainAxis().setTickMarksVisible(isShowTickMarks);
categoryPlot.getDomainAxis().setTickLabelsVisible(isShowTickLabels);
BarRenderer categoryRenderer = (BarRenderer)categoryPlot.getRenderer();
boolean isShowLabels = barPlot.getShowLabels() == null ? false : barPlot.getShowLabels().booleanValue();
categoryRenderer.setBaseItemLabelsVisible( isShowLabels );
if(isShowLabels)
  categoryRenderer.setBaseItemLabelFont(JRFontUtil.getAwtFont(font, getLocale()));
  if(itemLabel != null)
      categoryRenderer.setBaseItemLabelPaint(itemLabel.getColor());
      categoryRenderer.setBaseItemLabelPaint(getChart().getForecolor());
      categoryRenderer.setBaseItemLabelGenerator((CategoryItemLabelGenerator)getLabelGenerator());
    categoryRenderer.setBaseItemLabelGenerator((CategoryItemLabelGenerator)getLabelGenerator());
    categoryRenderer.setBaseItemLabelPaint(getChart().getForecolor());
categoryRenderer.setShadowVisible(false);
org.jfree.chart.renderer.categoryBarRenderer

Javadoc

A CategoryItemRenderer that draws individual data items as bars. The example shown here is generated by the BarChartDemo1.javaprogram included in the JFreeChart Demo Collection:

Most used methods

  • setShadowVisible
    Sets the flag that controls whether or not shadows are drawn by the renderer.
  • <init>
    Creates a new bar renderer with default settings.
  • setBarPainter
    Sets the bar painter for this renderer and sends a RendererChangeEvent to all registered listeners.
  • setDrawBarOutline
    Sets the flag that controls whether or not bar outlines are drawn and sends a RendererChangeEvent to
  • setSeriesPaint
  • setItemMargin
    Sets the item margin and sends a RendererChangeEvent to all registered listeners. The value is expre
  • setBaseItemLabelGenerator
  • setBaseItemLabelsVisible
  • setBaseToolTipGenerator
  • setMaximumBarWidth
    Sets the maximum bar width, which is specified as a percentage of the available space for all bars,
  • setBaseItemLabelFont
  • setBasePositiveItemLabelPosition
  • setBaseItemLabelFont,
  • setBasePositiveItemLabelPosition,
  • setShadowPaint,
  • setBaseItemURLGenerator,
  • getGradientPaintTransformer,
  • getItemMargin,
  • getPlot,
  • getShadowsVisible,
  • setBaseItemLabelPaint,
  • setBaseNegativeItemLabelPosition

Popular in Java

  • Reading from database using SQL prepared statement
  • setContentView (Activity)
  • addToBackStack (FragmentTransaction)
  • getSharedPreferences (Context)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • JComboBox (javax.swing)
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now