Class TimeSeries

java.lang.Object
org.aesh.charts.common.TimeSeries

public class TimeSeries extends Object
A time-indexed data series where the X-axis represents timestamps.
  • Constructor Details

    • TimeSeries

      public TimeSeries(String name)
  • Method Details

    • of

      public static TimeSeries of(String name, long[] timestamps, double[] values)
      Create from arrays.
    • of

      public static TimeSeries of(String name, List<Instant> timestamps, List<Double> values)
      Create from Instant list.
    • from

      public static <T> TimeSeries from(String name, List<T> data, ToLongFunction<T> timestampAccessor, ToDoubleFunction<T> valueAccessor)
      Create from typed objects using accessor functions.
    • add

      public void add(long epochMillis, double value)
    • addInstant

      public void addInstant(Instant time, double value)
    • name

      public String name()
    • size

      public int size()
    • timestampAt

      public long timestampAt(int index)
    • valueAt

      public double valueAt(int index)
    • timestamps

      public List<Long> timestamps()
    • values

      public List<Double> values()
    • startTime

      public long startTime()
    • endTime

      public long endTime()
    • minValue

      public double minValue()
    • maxValue

      public double maxValue()
    • toDataSeries

      public DataSeries toDataSeries()
      Convert to a DataSeries where X = epoch millis as doubles.
    • color

      public String color()
    • color

      public TimeSeries color(String color)
    • lineStyle

      public LineStyle lineStyle()
    • lineStyle

      public TimeSeries lineStyle(LineStyle lineStyle)