congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
WaterfallBarRenderer
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: org.codehaus.jtstand/jtstand-chart

/**
 * Sets the paint that will be used to draw bars having positive values.
 *
 * @param paint  the paint (<code>null</code> not permitted).
 */
public void setPositiveBarPaint(Paint paint) {
  if (paint == null) {
    throw new IllegalArgumentException("Null 'paint' argument");
  }
  this.positiveBarPaint = paint;
  fireChangeEvent();
}
origin: org.codehaus.jtstand/jtstand-chart

int categoryCount = getColumnCount();
PlotOrientation orientation = plot.getOrientation();
double rectHeight = Math.max(getMinimumBarLength(),
    Math.abs(j2dy1 - j2dy0));
if (orientation == PlotOrientation.HORIZONTAL) {
  rectY = domainAxis.getCategorySeriesMiddle(categoryKey, seriesKey,
      dataset, getItemMargin(), dataArea, RectangleEdge.LEFT);
  rectWidth = Math.max(getMinimumBarLength(),
      Math.abs(j2dy1 - j2dy0));
      dataset, getItemMargin(), dataArea, RectangleEdge.TOP);
  rectX = rectX - rectWidth / 2.0;
  rectY = j2dy0;
Paint seriesPaint;
if (column == 0) {
  seriesPaint = getFirstBarPaint();
  seriesPaint = getLastBarPaint();
    seriesPaint = getNegativeBarPaint();
    seriesPaint = getPositiveBarPaint();
    seriesPaint = getLastBarPaint();
origin: dynamicreports/dynamicreports

public void customize(JFreeChart chart, ReportParameters reportParameters) {
  BarRenderer categoryRenderer = (BarRenderer) chart.getCategoryPlot().getRenderer();
  WaterfallBarRenderer renderer = new WaterfallBarRenderer();
  renderer.setBaseItemLabelsVisible(categoryRenderer.getBaseItemLabelsVisible());
  renderer.setBaseItemLabelFont(categoryRenderer.getBaseItemLabelFont());
  renderer.setBaseItemLabelPaint(categoryRenderer.getBaseItemLabelPaint());
  renderer.setBaseItemLabelGenerator(categoryRenderer.getBaseItemLabelGenerator());
  renderer.setShadowVisible(categoryRenderer.getShadowsVisible());
  CategoryDataset categoryDataset = chart.getCategoryPlot().getDataset();
  if (categoryDataset != null) {
      Paint seriesOutlinePaint = categoryRenderer.getSeriesOutlinePaint(i);
      if (seriesOutlinePaint != null) {
        renderer.setSeriesOutlinePaint(i, seriesOutlinePaint);
        renderer.setSeriesPaint(i, seriesPaint);
  renderer.setItemMargin(categoryRenderer.getItemMargin());
  GradientPaintTransformer gradientPaintTransformer = categoryRenderer.getGradientPaintTransformer();
  if (gradientPaintTransformer != null) {
    renderer.setGradientPaintTransformer(gradientPaintTransformer);
    renderer.setFirstBarPaint(firstBarPaint);
    renderer.setLastBarPaint(lastBarPaint);
    renderer.setPositiveBarPaint(positiveBarPaint);
origin: org.codehaus.jtstand/jtstand-chart

WaterfallBarRenderer renderer = new WaterfallBarRenderer();
if (orientation == PlotOrientation.HORIZONTAL) {
  ItemLabelPosition position = new ItemLabelPosition(
      ItemLabelAnchor.CENTER, TextAnchor.CENTER,
      TextAnchor.CENTER, Math.PI / 2.0);
  renderer.setBasePositiveItemLabelPosition(position);
  renderer.setBaseNegativeItemLabelPosition(position);
      ItemLabelAnchor.CENTER, TextAnchor.CENTER,
      TextAnchor.CENTER, 0.0);
  renderer.setBasePositiveItemLabelPosition(position);
  renderer.setBaseNegativeItemLabelPosition(position);
  renderer.setBaseToolTipGenerator(generator);
  renderer.setBaseItemURLGenerator(
      new StandardCategoryURLGenerator());
origin: jfree/jfreechart

WaterfallBarRenderer renderer = new WaterfallBarRenderer();
if (orientation == PlotOrientation.HORIZONTAL) {
  ItemLabelPosition position = new ItemLabelPosition(
      ItemLabelAnchor.CENTER, TextAnchor.CENTER,
      TextAnchor.CENTER, Math.PI / 2.0);
  renderer.setDefaultPositiveItemLabelPosition(position);
  renderer.setDefaultNegativeItemLabelPosition(position);
      ItemLabelAnchor.CENTER, TextAnchor.CENTER,
      TextAnchor.CENTER, 0.0);
  renderer.setDefaultPositiveItemLabelPosition(position);
  renderer.setDefaultNegativeItemLabelPosition(position);
  renderer.setDefaultToolTipGenerator(generator);
  renderer.setDefaultItemURLGenerator(
      new StandardCategoryURLGenerator());
origin: org.codehaus.jtstand/jtstand-chart

this.positiveBarPaint = positiveBarPaint;
this.negativeBarPaint = negativeBarPaint;
setGradientPaintTransformer(new StandardGradientPaintTransformer(
    GradientPaintTransformType.CENTER_VERTICAL));
setMinimumBarLength(1.0);
origin: jfree/jfreechart

int categoryCount = getColumnCount();
PlotOrientation orientation = plot.getOrientation();
double rectHeight = Math.max(getMinimumBarLength(),
    Math.abs(j2dy1 - j2dy0));
if (orientation == PlotOrientation.HORIZONTAL) {
  rectY = domainAxis.getCategorySeriesMiddle(categoryKey, seriesKey,
      dataset, getItemMargin(), dataArea, RectangleEdge.LEFT);
  rectWidth = Math.max(getMinimumBarLength(),
      Math.abs(j2dy1 - j2dy0));
      dataset, getItemMargin(), dataArea, RectangleEdge.TOP);
  rectX = rectX - rectWidth / 2.0;
  rectY = j2dy0;
Paint seriesPaint;
if (column == 0) {
  seriesPaint = getFirstBarPaint();
  seriesPaint = getLastBarPaint();
    seriesPaint = getPositiveBarPaint();
  } else {
    seriesPaint = getNegativeBarPaint();
if (getGradientPaintTransformer() != null
    && seriesPaint instanceof GradientPaint) {
origin: jfree/jfreechart

/**
 * Constructs a new waterfall renderer.
 *
 * @param firstBarPaint  the color of the first bar ({@code null} not
 *                       permitted).
 * @param positiveBarPaint  the color for bars with positive values
 *                          ({@code null} not permitted).
 * @param negativeBarPaint  the color for bars with negative values
 *                          ({@code null} not permitted).
 * @param lastBarPaint  the color of the last bar ({@code null} not
 *                      permitted).
 */
public WaterfallBarRenderer(Paint firstBarPaint, Paint positiveBarPaint,
    Paint negativeBarPaint, Paint lastBarPaint) {
  super();
  Args.nullNotPermitted(firstBarPaint, "firstBarPaint");
  Args.nullNotPermitted(positiveBarPaint, "positiveBarPaint");
  Args.nullNotPermitted(negativeBarPaint, "negativeBarPaint");
  Args.nullNotPermitted(lastBarPaint, "lastBarPaint");
  this.firstBarPaint = firstBarPaint;
  this.lastBarPaint = lastBarPaint;
  this.positiveBarPaint = positiveBarPaint;
  this.negativeBarPaint = negativeBarPaint;
  setGradientPaintTransformer(new StandardGradientPaintTransformer(
      GradientPaintTransformType.CENTER_VERTICAL));
  setMinimumBarLength(1.0);
}
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Sets the paint that will be used to draw the first bar and sends a
 * {@link RendererChangeEvent} to all registered listeners.
 *
 * @param paint  the paint (<code>null</code> not permitted).
 */
public void setFirstBarPaint(Paint paint) {
  if (paint == null) {
    throw new IllegalArgumentException("Null 'paint' argument");
  }
  this.firstBarPaint = paint;
  fireChangeEvent();
}
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Sets the paint that will be used to draw the last bar and sends a
 * {@link RendererChangeEvent} to all registered listeners.
 *
 * @param paint  the paint (<code>null</code> not permitted).
 */
public void setLastBarPaint(Paint paint) {
  if (paint == null) {
    throw new IllegalArgumentException("Null 'paint' argument");
  }
  this.lastBarPaint = paint;
  fireChangeEvent();
}
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Sets the paint that will be used to draw bars having negative values,
 * and sends a {@link RendererChangeEvent} to all registered listeners.
 *
 * @param paint  the paint (<code>null</code> not permitted).
 */
public void setNegativeBarPaint(Paint paint) {
  if (paint == null) {
    throw new IllegalArgumentException("Null 'paint' argument");
  }
  this.negativeBarPaint = paint;
  fireChangeEvent();
}
origin: jfree/jfreechart

/**
 * Sets the paint that will be used to draw bars having negative values,
 * and sends a {@link RendererChangeEvent} to all registered listeners.
 *
 * @param paint  the paint ({@code null} not permitted).
 */
public void setNegativeBarPaint(Paint paint) {
  Args.nullNotPermitted(paint, "paint");
  this.negativeBarPaint = paint;
  fireChangeEvent();
}
origin: jfree/jfreechart

/**
 * Sets the paint that will be used to draw the last bar and sends a
 * {@link RendererChangeEvent} to all registered listeners.
 *
 * @param paint  the paint ({@code null} not permitted).
 */
public void setLastBarPaint(Paint paint) {
  Args.nullNotPermitted(paint, "paint");
  this.lastBarPaint = paint;
  fireChangeEvent();
}
origin: jfree/jfreechart

/**
 * Sets the paint that will be used to draw the first bar and sends a
 * {@link RendererChangeEvent} to all registered listeners.
 *
 * @param paint  the paint ({@code null} not permitted).
 */
public void setFirstBarPaint(Paint paint) {
  Args.nullNotPermitted(paint, "paint");
  this.firstBarPaint = paint;
  fireChangeEvent();
}
origin: jfree/jfreechart

/**
 * Sets the paint that will be used to draw bars having positive values.
 *
 * @param paint  the paint ({@code null} not permitted).
 */
public void setPositiveBarPaint(Paint paint) {
  Args.nullNotPermitted(paint, "paint");
  this.positiveBarPaint = paint;
  fireChangeEvent();
}
org.jfree.chart.renderer.categoryWaterfallBarRenderer

Javadoc

A renderer that handles the drawing of waterfall bar charts, for use with the CategoryPlot class. Some quirks to note:
  • the value in the last category of the dataset should be (redundantly) specified as the sum of the items in the preceding categories - otherwise the final bar in the plot will be incorrectly plotted;
  • the bar colors are defined using special methods in this class - the inherited methods (for example, AbstractRenderer#setSeriesPaint(int,Paint)) are ignored;
The example shown here is generated by the WaterfallChartDemo1.java program included in the JFreeChart Demo Collection:

Most used methods

  • <init>
    Constructs a new waterfall renderer.
  • setGradientPaintTransformer
  • addItemEntity
  • drawItemLabel
  • fireChangeEvent
  • getColumnCount
  • getFirstBarPaint
    Returns the paint used to draw the first bar.
  • getGradientPaintTransformer
  • getItemLabelGenerator
  • getItemMargin
  • getItemOutlinePaint
  • getItemOutlineStroke
  • getItemOutlinePaint,
  • getItemOutlineStroke,
  • getLastBarPaint,
  • getMinimumBarLength,
  • getNegativeBarPaint,
  • getPositiveBarPaint,
  • isDrawBarOutline,
  • isItemLabelVisible,
  • setMinimumBarLength,
  • setBaseItemLabelFont

Popular in Java

  • Running tasks concurrently on multiple threads
  • setRequestProperty (URLConnection)
  • getContentResolver (Context)
  • findViewById (Activity)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • ImageIO (javax.imageio)
  • Table (org.hibernate.mapping)
    A relational table
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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