Skip to content

GemTimeSeriesChart

A time series chart is a data visualization tool that plots data points at successive intervals of time. It is used to show how data changes over time. For example, it can be used to monitor a machine's live sensor readings, or to display historical stock prices annotated with relevant news events.

GUI Model

component GemTimeSeriesChart(
  TimeSeriesData data,
  boolean hideLiveDataToggle = false,
  String width = "100%",
  String height = "350px",
  LocalDateTime showAfter,
  LocalDateTime showUntil,
  String viewPort = "",
  String chartType = "area",
  Event<TimeSeriesEvent> eventClick,
  boolean showConfig = false
)
Name Type Description Default value
data TimeSeriesData The data to be displayed in the chart. Contains series of data points (timestamp, value) and events.
hideLiveDataToggle boolean If true, the button to toggle live data updates is hidden. false
width String Width of the chart container as a valid CSS length (e.g., "100%", "500px"). "100%"
height String Height of the chart container as a valid CSS length (e.g., "350px", "50vh"). "350px"
showAfter LocalDateTime Optional start time for the visible range (zoom). If set, the chart will zoom to show data after this time.
showUntil LocalDateTime Optional end time for the visible range (zoom). If set, the chart will zoom to show data until this time.
viewPort String Optional viewport definition for a sliding window. Examples: '60s' (last 60 seconds), '5m' (5 minutes), '100p' (last 100 points). ""
chartType String Rendering style of the series: "area" (line with a soft fill) or "line". With many overlapping series, "line" is usually more readable. "area"
eventClick Event<TimeSeriesEvent> Callback triggered when an event annotation is clicked.
showConfig boolean Whether the chart's configuration panel is shown. false

Types

GemTimeSeriesChartTypes

package mc.fenix.charts;

import java.util.List;
import java.util.Optional;
import java.time.LocalDateTime;

<<pojoCD>>
classdiagram GemTimeSeriesChartTypes {
  class TimeSeriesData {
    List<TimeSeries> series;
    List<TimeSeriesEvent> events;
  }

  class TimeSeries {
    Long identifier;
    String name;
    Optional<String> color;
    boolean hidden;
    boolean deactivated;
    List<TimeSeriesDataPoint> datapoints;
  }

  class TimeSeriesDataPoint {
    LocalDateTime timestamp;
    Double value;
  }

  class TimeSeriesEvent {
    LocalDateTime timestamp;
    String name;
    Optional<String> textColor;
    Optional<String> backgroundColor;
    boolean show;
  }
}

TimeSeriesData

Name Type Description Default value
series List<TimeSeries>
events List<TimeSeriesEvent>

TimeSeries

Name Type Description Default value
identifier Long
name String
color Optional<String>
hidden boolean
deactivated boolean
datapoints List<TimeSeriesDataPoint>

TimeSeriesDataPoint

Name Type Description Default value
timestamp LocalDateTime
value Double

TimeSeriesEvent

Name Type Description Default value
timestamp LocalDateTime
name String
textColor Optional<String>
backgroundColor Optional<String>
show boolean