Class BarSeries

    • Field Detail

      • INITIAL_BAR_WIDTH

        public static final int INITIAL_BAR_WIDTH
        the initial bar width in pixels
        See Also:
        Constant Field Values
      • INITIAL_PADDING

        public static final int INITIAL_PADDING
        the initial bar padding in percentage
        See Also:
        Constant Field Values
    • Constructor Detail

      • BarSeries

        protected BarSeries​(Chart chart,
                            java.lang.String id)
        Constructor.
        Parameters:
        chart - the chart
        id - the series id
    • Method Detail

      • getBarWidth

        public int getBarWidth()
        Description copied from interface: IBarSeries
        Gets the bar width in pixels.
        Specified by:
        getBarWidth in interface IBarSeries
        Returns:
        the bar width in pixels
      • setBarWidth

        public void setBarWidth​(int width)
        Description copied from interface: IBarSeries
        Sets the bar width in pixels. The specified bar width is active only when the bar width style is set to BarWidthStyle.FIXED.
        Specified by:
        setBarWidth in interface IBarSeries
        Parameters:
        width - the bar width in pixels
      • getBarPadding

        public int getBarPadding()
        Description copied from interface: IBarSeries
        Gets the bar padding in percentage.
        Specified by:
        getBarPadding in interface IBarSeries
        Returns:
        the bar padding in percentage
      • setBarPadding

        public void setBarPadding​(int padding)
        Description copied from interface: IBarSeries
        Sets the bar padding in percentage. The specified padding is active only when the bar width style is set to BarWidthStyle.STRETCHED.
        Specified by:
        setBarPadding in interface IBarSeries
        Parameters:
        padding - the bar padding in percentage
      • getBarColor

        public Color getBarColor()
        Description copied from interface: IBarSeries
        Gets the bar color.
        Specified by:
        getBarColor in interface IBarSeries
        Returns:
        the bar color
      • setBarColor

        public void setBarColor​(Color color)
        Description copied from interface: IBarSeries
        Sets the bar color. If null is given, default color will be set.
        Specified by:
        setBarColor in interface IBarSeries
        Parameters:
        color - the bar color
      • getBounds

        public Rectangle[] getBounds()
        Description copied from interface: IBarSeries
        Gets the array of bar rectangles. This method is typically used for mouse listener to check whether mouse cursor is on bar.

        The returned array has the same size as data points. Depending on X axis range, some bars can be out of screen. In this case, the rectangles for invisible bars will be null in the returned array.

        Specified by:
        getBounds in interface IBarSeries
        Returns:
        the array of bar rectangles in pixels.
      • setRiserIndex

        protected void setRiserIndex​(int riserIndex)
        Sets the index of riser in a category.
        Parameters:
        riserIndex - the index of riser in a category
      • setCompressor

        protected void setCompressor()
        Description copied from class: Series
        Sets the compressor.
        Specified by:
        setCompressor in class Series
      • getAdjustedRange

        public Range getAdjustedRange​(Axis axis,
                                      int length)
        Description copied from class: Series
        Gets the adjusted range to show all series in screen. This range includes the size of plot like symbol or bar.
        Specified by:
        getAdjustedRange in class Series
        Parameters:
        axis - the axis
        length - the axis length in pixels
        Returns:
        the adjusted range
      • draw

        protected void draw​(GC gc,
                            int width,
                            int height,
                            Axis xAxis,
                            Axis yAxis)
        Description copied from class: Series
        Draws series.
        Specified by:
        draw in class Series
        Parameters:
        gc - the graphics context
        width - the width to draw series
        height - the height to draw series
        xAxis - the x axis
        yAxis - the y axis