Class ErrorBarSeries


public class ErrorBarSeries extends XYSeries

Values with an uncertainty interval, drawn as a marker with whiskers. Layer it over a bar or line series of the same values to add error bars to them.

double[] mean = {5, 7, 6}, low = {4, 6, 4.5}, high = {6, 8.5, 7};
new ErrorBarSeries("Mean").setIntervals(null, mean, low, high);

Error bars

  • Constructor Details

    • ErrorBarSeries

      public ErrorBarSeries(String name)

      Creates an empty series.

      Parameters
      • name: the series name
  • Method Details

    • setIntervals

      public ErrorBarSeries setIntervals(double[] x, double[] value, double[] low, double[] high)

      Replaces all values.

      Parameters
      • x: x values, or null for 0, 1, 2...

      • value: the central values

      • low: the lower end of each interval

      • high: the upper end of each interval

      Returns

      this series

    • setMarkers

      public ErrorBarSeries setMarkers(boolean m)

      Shows or hides the marker at the central value, for overlaying on bars.

      Parameters
      • m: true to draw markers
      Returns

      this series

    • getLow

      public double getLow(int i)
      The lower end of interval i.
    • getHigh

      public double getHigh(int i)
      The upper end of interval i.
    • getYBounds

      public double[] getYBounds()
      Description copied from class: Series
      The extent of the data along y, {min, max}, or null when empty or not cartesian.
      Overrides:
      getYBounds in class XYSeries
    • paint

      public void paint(ChartContext ctx)
      Description copied from class: Series

      Paints the series.

      Parameters
      • ctx: the current frame: graphics, plot area, axes and animation progress
      Specified by:
      paint in class Series
    • formatTooltip

      public String formatTooltip(ChartContext ctx, ChartPoint p)
      Description copied from class: Series

      The tooltip row for a point: the series or point name and its formatted value. Series with several values per point (open/high/low/close, ranges, box plots) override this.

      Parameters
      • ctx: the last paint context

      • p: the point

      Returns

      one line of text

      Overrides:
      formatTooltip in class Series
    • tableValue

      protected String tableValue(int i)
      Description copied from class: XYSeries

      The text of point i in the accessible data table.

      Parameters
      • i: the point index
      Returns

      the formatted value

      Overrides:
      tableValue in class XYSeries