Skip to contents

Portable, materialized annotation geometry. Corresponds to MarkLineOption, MarkAreaOption, and ScatterSeriesOption in ECharts src/component/marker and src/chart/scatter. Coordinates are data values (epoch milliseconds for time axes); categorical coordinates may be category names. Layers are independent of group legend selection.

Usage

AnnotationLayer(
  hline = NULL,
  vline = NULL,
  x = numeric(0),
  y = numeric(0),
  text = NULL,
  bands = list(),
  color = "#888888",
  line_type = "dashed",
  opacity = 0.15,
  x_axis = 0L,
  y_axis = 0L
)

Arguments

hline, vline

Numeric: Horizontal and vertical reference positions.

x, y

Numeric or Character: Coordinates for text annotations.

text

Character: One label per coordinate pair.

bands

List: Numeric length-two x intervals to shade.

color

Character: Annotation color.

line_type

Character {"solid", "dashed", "dotted"}: Reference line style.

opacity

Numeric [0, 1]: Band opacity.

x_axis, y_axis

Integer [0, Inf): Zero-based target axis indices.

Value

AnnotationLayer: Validated annotation geometry.

Examples

AnnotationLayer(hline = 0, text = "Peak", x = 2, y = 3)
#> <rtemis.draw::AnnotationLayer>
#>  @ hline    : num 0
#>  @ vline    : NULL
#>  @ x        : num 2
#>  @ y        : num 3
#>  @ text     : chr "Peak"
#>  @ bands    : list()
#>  @ color    : chr "#888888"
#>  @ line_type: chr "dashed"
#>  @ opacity  : num 0.15
#>  @ x_axis   : int 0
#>  @ y_axis   : int 0