Skip to content

Type Alias: Annotation

ts
type Annotation = 
  | {
  color?: string;
  dash?: number[];
  dim: Dim;
  type: "span";
  value: number;
  width?: number;
  yAxis?: string;
}
  | {
  color?: string;
  dim: Dim;
  from: number;
  to: number;
  type: "band";
  yAxis?: string;
}
  | {
  border?: string;
  color?: string;
  label?: string;
  type: "box";
  x: Range;
  y: Range;
  yAxis?: string;
}
  | {
  align?: "left" | "center" | "right";
  baseline?: CanvasTextBaseline;
  color?: string;
  dx?: number;
  dy?: number;
  font?: string;
  text: string;
  type: "label";
  x: number;
  y: number;
  yAxis?: string;
}
  | {
  color?: string;
  dash?: number[];
  label?: string;
  type: "line";
  width?: number;
  x0: number;
  x1: number;
  y0: number;
  y1: number;
  yAxis?: string;
}
  | {
  color?: string;
  dash?: number[];
  label?: string;
  type: "ray";
  width?: number;
  x0: number;
  x1: number;
  y0: number;
  y1: number;
  yAxis?: string;
}
  | {
  color?: string;
  fill?: boolean;
  high: number;
  label?: string;
  low: number;
  ratios?: number[];
  type: "fib";
  x0: number;
  x1: number;
  yAxis?: string;
};

Defined in: plot.ts:159

A Canvas2D overlay marker drawn above the data, projected through the scales: a full-width/height guide line (span), a shaded range (band), a rectangle (box), text (label), an arbitrary segment (line — trendlines), a segment extended past its end (ray), or Fibonacci retracement levels (fib). yAxis targets a secondary axis where relevant. All coordinates are in data space, so annotations pan and zoom with the chart.

MIT licensed. WebGL2 required.