Skip to contents

Adds independent native ECharts layers to an existing drawing. For panels, annotate the children before composition. Annotation coordinates use the existing axes and may extend their automatic ranges; explicit limits remain authoritative. References and bands do not alter data summaries.

Usage

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

Arguments

plot

htmlwidget: An ECharts drawing.

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.

layer

Optional AnnotationLayer: Complete geometry. Do not combine with annotation convenience arguments.

Value

htmlwidget: The drawing with an additional vector annotation layer.

Examples

draw_annotate(draw_scatter(1:5, c(2, 3, 1, 5, 4)), hline = 3)