Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.java4less.rchart
Class BarDataSerie

    java.lang.Object
      |
      +--com.java4less.rchart.DataSerie
            |
            +--com.java4less.rchart.BarDataSerie

public class BarDataSerie
extends DataSerie

    A BarDataSerie is a DataSerie that will be plotted using bars (horizontal) or columns (vertical).

    Example of use:

    double[] d1={1,2,3,4,5,4,2};
    BarDataSerie data1= new BarDataSerie(d1,new FillStyle(GraphicsProvider.getColor(ChartColor.ORANGE)));
    data1.borderType=BarDataSerie.BORDER_RAISED;
    data1.valueFont=new Font("Arial",Font.BOLD,10);

    double[] d2={2,3,4,4.2,6.4,4.5,6.1};
    BarDataSerie data2= new BarDataSerie(d2,new FillStyle(GraphicsProvider.getColor(ChartColor.GREEN)));
    data2.valueFont=new Font("Arial",Font.BOLD,10);
    data2.borderType=BarDataSerie.BORDER_RAISED;
    data2.negativeStyle=new FillStyle(GraphicsProvider.getColor(ChartColor.RED));

Field Summary
`FillStyle[]` | `barStyles`
`LineStyle` | `border` If borderType is BORDER_NORMAL, this style will be used to draw the border.
`static int` | `BORDER_LOWERED`
`static int` | `BORDER_NO`
`static int` | `BORDER_NORMAL`
`static int` | `BORDER_RAISED`
`LineStyle` | `border2` see border.
`int` | `borderType` Type of border of the bars.
`LineStyle` | `negativeborder` Like "border" for negatives values.
`LineStyle` | `negativeborder2` Like "border2" for negatives values.
`FillStyle` | `negativeStyle` Fill styled used to fill the bar if negative.
`FillStyle` | `style` Fill styled used to fill the bar.
`ChartColor` | `valueColor` color used to display the values of the bars.
`ChartFont` | `valueFont` Font used to display the values of the bars.

Fields inherited from class com.java4less.rchart.DataSerie
`dataLabels, hotAreas, htmlLinks, labelTemplate, name, nullValue, secondaryXAxis, secondaryYAxis, secondYAxis, tips, valueFormat`

Constructor Summary
`BarDataSerie(double[] x, double[] y, FillStyle s)` Creates a serie with the specified values (points x,y) and style.
`BarDataSerie(double[] y, FillStyle s)` Creates a serie with the specified values and style.
`BarDataSerie(FillStyle s)` Creates an empty serie with the specifed style.

Method Summary
`void` | `addBarsBase(double[] b)` Adds one interval to the serie.

Methods inherited from class com.java4less.rchart.DataSerie
`addData, getElementX, getElementY, getSize, replaceXValueAt, replaceXYValueAt, replaceYValueAt, setDatax`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### BORDER_NORMAL

    public static final int BORDER_NORMAL

See Also:
  Constant Field Values

### BORDER_LOWERED

    public static final int BORDER_LOWERED

See Also:
  Constant Field Values

### BORDER_RAISED

    public static final int BORDER_RAISED

See Also:
  Constant Field Values

### BORDER_NO

    public static final int BORDER_NO

See Also:
  Constant Field Values

### style

    public FillStyle style

  Fill styled used to fill the bar.

### negativeStyle

    public FillStyle negativeStyle

  Fill styled used to fill the bar if negative.

### border

    public LineStyle border

  If borderType is BORDER_NORMAL, this style will be used to draw the border. If borderType is BORDER_RAISED or BORDER_LOWERED two borders are needed (border and border2). The RAISED or LOWERED effect is achieved by combining two borders of different color. The default is gray (shadowed border) and white (light border).

### border2

    public LineStyle border2

  see border.

### negativeborder

    public LineStyle negativeborder

  Like "border" for negatives values.

### negativeborder2

    public LineStyle negativeborder2

  Like "border2" for negatives values.

### valueColor

    public ChartColor valueColor

  color used to display the values of the bars.

### valueFont

    public ChartFont valueFont

  Font used to display the values of the bars.

### borderType

    public int borderType

  Type of border of the bars. Valid values are BORDER_NO, BORDER_NORMAL, BORDER_RAISED, and BORDER_LOWERED.

### barStyles

    public FillStyle[] barStyles

Constructor Detail

### BarDataSerie

    public BarDataSerie(FillStyle s)

  Creates an empty serie with the specifed style.

Parameters:
  `s` - fill style

### BarDataSerie

    public BarDataSerie(double[] x,
                        double[] y,
                        FillStyle s)

  Creates a serie with the specified values (points x,y) and style.

Parameters:
  `x` - array of x values
  `y` - array of y values
  `s` - fill style

### BarDataSerie

    public BarDataSerie(double[] y,
                        FillStyle s)

  Creates a serie with the specified values and style. The values for x will be 0,1,2,3...

Parameters:
  `y` - array of x values
  `s` - fill style

Method Detail

### addBarsBase

    public void addBarsBase(double[] b)

  Adds one interval to the serie.

  Parameters:
    `b` - array of values

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD