Documentation of 'org.jfree.chart.renderer.category.BarRenderer' Java class
BarRenderer
org.jfree.chart.renderer.category

Class BarRenderer

    • Field Detail

      • DEFAULT_ITEM_MARGIN

        public static final double DEFAULT_ITEM_MARGIN
        The default item margin percentage.
        See Also:
        Constant Field Values
      • BAR_OUTLINE_WIDTH_THRESHOLD

        public static final double BAR_OUTLINE_WIDTH_THRESHOLD
        Constant that controls the minimum width before a bar has an outline drawn.
        See Also:
        Constant Field Values
    • Constructor Detail

      • BarRenderer

        public BarRenderer()
        Creates a new bar renderer with default settings.
    • Method Detail

      • getDefaultBarPainter

        public static BarPainter getDefaultBarPainter()
        Returns the default bar painter.
        Returns:
        The default bar painter.
        Since:
        1.0.11
      • setDefaultBarPainter

        public static void setDefaultBarPainter(BarPainter painter)
        Sets the default bar painter.
        Parameters:
        painter - the painter (null not permitted).
        Since:
        1.0.11
      • getDefaultShadowsVisible

        public static boolean getDefaultShadowsVisible()
        Returns the default value for the shadowsVisible flag.
        Returns:
        A boolean.
        Since:
        1.0.13
        See Also:
        setDefaultShadowsVisible(boolean)
      • setDefaultShadowsVisible

        public static void setDefaultShadowsVisible(boolean visible)
        Sets the default value for the shadows visible flag.
        Parameters:
        visible - the new value for the default.
        Since:
        1.0.13
        See Also:
        getDefaultShadowsVisible()
      • getBase

        public double getBase()
        Returns the base value for the bars. The default value is 0.0.
        Returns:
        The base value for the bars.
        See Also:
        setBase(double)
      • setBase

        public void setBase(double base)
        Sets the base value for the bars and sends a RendererChangeEvent to all registered listeners.
        Parameters:
        base - the new base value.
        See Also:
        getBase()
      • getItemMargin

        public double getItemMargin()
        Returns the item margin as a percentage of the available space for all bars.
        Returns:
        The margin percentage (where 0.10 is ten percent).
        See Also:
        setItemMargin(double)
      • setItemMargin

        public void setItemMargin(double percent)
        Sets the item margin and sends a RendererChangeEvent to all registered listeners. The value is expressed as a percentage of the available width for plotting all the bars, with the resulting amount to be distributed between all the bars evenly.
        Parameters:
        percent - the margin (where 0.10 is ten percent).
        See Also:
        getItemMargin()
      • isDrawBarOutline

        public boolean isDrawBarOutline()
        Returns a flag that controls whether or not bar outlines are drawn.
        Returns:
        A boolean.
        See Also:
        setDrawBarOutline(boolean)
      • setDrawBarOutline

        public void setDrawBarOutline(boolean draw)
        Sets the flag that controls whether or not bar outlines are drawn and sends a RendererChangeEvent to all registered listeners.
        Parameters:
        draw - the flag.
        See Also:
        isDrawBarOutline()
      • getMaximumBarWidth

        public double getMaximumBarWidth()
        Returns the maximum bar width, as a percentage of the available drawing space.
        Returns:
        The maximum bar width.
        See Also:
        setMaximumBarWidth(double)
      • setMaximumBarWidth

        public void setMaximumBarWidth(double percent)
        Sets the maximum bar width, which is specified as a percentage of the available space for all bars, and sends a RendererChangeEvent to all registered listeners.
        Parameters:
        percent - the percent (where 0.05 is five percent).
        See Also:
        getMaximumBarWidth()
      • getMinimumBarLength

        public double getMinimumBarLength()
        Returns the minimum bar length (in Java2D units). The default value is 0.0.
        Returns:
        The minimum bar length.
        See Also:
        setMinimumBarLength(double)
      • setMinimumBarLength

        public void setMinimumBarLength(double min)
        Sets the minimum bar length and sends a RendererChangeEvent to all registered listeners. The minimum bar length is specified in Java2D units, and can be used to prevent bars that represent very small data values from disappearing when drawn on the screen. Typically you would set this to (say) 0.5 or 1.0 Java 2D units. Use this attribute with caution, however, because setting it to a non-zero value will artificially increase the length of bars representing small values, which may misrepresent your data.
        Parameters:
        min - the minimum bar length (in Java2D units, must be >= 0.0).
        See Also:
        getMinimumBarLength()
      • getGradientPaintTransformer

        public org.jfree.ui.GradientPaintTransformer getGradientPaintTransformer()
        Returns the gradient paint transformer (an object used to transform gradient paint objects to fit each bar).
        Returns:
        A transformer (null possible).
        See Also:
        setGradientPaintTransformer(GradientPaintTransformer)
      • setGradientPaintTransformer

        public void setGradientPaintTransformer(org.jfree.ui.GradientPaintTransformer transformer)
        Sets the gradient paint transformer and sends a RendererChangeEvent to all registered listeners.
        Parameters:
        transformer - the transformer (null permitted).
        See Also:
        getGradientPaintTransformer()
      • setBarPainter

        public void setBarPainter(BarPainter painter)
        Sets the bar painter for this renderer and sends a RendererChangeEvent to all registered listeners.
        Parameters:
        painter - the painter (null not permitted).
        Since:
        1.0.11
        See Also:
        getBarPainter()
      • getShadowsVisible

        public boolean getShadowsVisible()
        Returns the flag that controls whether or not shadows are drawn for the bars.
        Returns:
        A boolean.
        Since:
        1.0.11
      • setShadowVisible

        public void setShadowVisible(boolean visible)
        Sets the flag that controls whether or not shadows are drawn by the renderer.
        Parameters:
        visible - the new flag value.
        Since:
        1.0.11
      • getShadowPaint

        public java.awt.Paint getShadowPaint()
        Returns the shadow paint.
        Returns:
        The shadow paint.
        Since:
        1.0.11
        See Also:
        setShadowPaint(Paint)
      • setShadowPaint

        public void setShadowPaint(java.awt.Paint paint)
        Sets the shadow paint and sends a RendererChangeEvent to all registered listeners.
        Parameters:
        paint - the paint (null not permitted).
        Since:
        1.0.11
        See Also:
        getShadowPaint()
      • getShadowXOffset

        public double getShadowXOffset()
        Returns the shadow x-offset.
        Returns:
        The shadow x-offset.
        Since:
        1.0.11
      • setShadowXOffset

        public void setShadowXOffset(double offset)
        Sets the x-offset for the bar shadow and sends a RendererChangeEvent to all registered listeners.
        Parameters:
        offset - the offset.
        Since:
        1.0.11
      • getShadowYOffset

        public double getShadowYOffset()
        Returns the shadow y-offset.
        Returns:
        The shadow y-offset.
        Since:
        1.0.11
      • setShadowYOffset

        public void setShadowYOffset(double offset)
        Sets the y-offset for the bar shadow and sends a RendererChangeEvent to all registered listeners.
        Parameters:
        offset - the offset.
        Since:
        1.0.11
      • getLowerClip

        public double getLowerClip()
        Returns the lower clip value. This value is recalculated in the initialise() method.
        Returns:
        The value.
      • getUpperClip

        public double getUpperClip()
        Returns the upper clip value. This value is recalculated in the initialise() method.
        Returns:
        The value.
      • initialise

        public CategoryItemRendererState initialise(java.awt.Graphics2D g2,
                                                    java.awt.geom.Rectangle2D dataArea,
                                                    CategoryPlot plot,
                                                    int rendererIndex,
                                                    PlotRenderingInfo info)
        Initialises the renderer and returns a state object that will be passed to subsequent calls to the drawItem method. This method gets called once at the start of the process of drawing a chart.
        Specified by:
        initialise in interface CategoryItemRenderer
        Overrides:
        initialise in class AbstractCategoryItemRenderer
        Parameters:
        g2 - the graphics device.
        dataArea - the area in which the data is to be plotted.
        plot - the plot.
        rendererIndex - the renderer index.
        info - collects chart rendering information for return to caller.
        Returns:
        The renderer state.
      • findRangeBounds

        public Range findRangeBounds(CategoryDataset dataset,
                                     boolean includeInterval)
        Returns the range of values the renderer requires to display all the items from the specified dataset. This takes into account the range of values in the dataset, plus the flag that determines whether or not the base value for the bars should be included in the range.
        Parameters:
        dataset - the dataset (null permitted).
        includeInterval - include the interval if the dataset has one?
        Returns:
        The range (or null if the dataset is null or empty).
      • drawItem

        public void drawItem(java.awt.Graphics2D g2,
                             CategoryItemRendererState state,
                             java.awt.geom.Rectangle2D dataArea,
                             CategoryPlot plot,
                             CategoryAxis domainAxis,
                             ValueAxis rangeAxis,
                             CategoryDataset dataset,
                             int row,
                             int column,
                             int pass)
        Draws the bar for a single (series, category) data item.
        Specified by:
        drawItem in interface CategoryItemRenderer
        Parameters:
        g2 - the graphics device.
        state - the renderer state.
        dataArea - the data area.
        plot - the plot.
        domainAxis - the domain axis.
        rangeAxis - the range axis.
        dataset - the dataset.
        row - the row index (zero-based).
        column - the column index (zero-based).
        pass - the pass index.
      • equals

        public boolean equals(java.lang.Object obj)
        Tests this instance for equality with an arbitrary object.
        Overrides:
        equals in class AbstractCategoryItemRenderer
        Parameters:
        obj - the object (null permitted).
        Returns:
        A boolean.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.