PhiaUi.Components.Data.MarkPoint (phia_ui v0.1.17)

Copy Markdown View Source

Data point marker component for charts.

Marks statistical points (max, min, average) on a chart with a symbol and optional label. Auto-detects position from data using ChartPipeline.stats/1.

Inspired by eCharts markPoint.

Examples

<.mark_point
  data={[%{label: "Q1", value: 100}, %{label: "Q2", value: 200}, %{label: "Q3", value: 150}]}
  types={[:max, :min]}
  x_scale={x_scale_fn}
  y_scale={y_scale_fn}
/>

Summary

Functions

mark_point(assigns)

Attributes

  • data (:list) - List of %{label, value} data points. Defaults to [].
  • types (:list) - List of mark types to show. Options: :max, :min, :average. Defaults to [:max, :min].
  • x_scale (:any) - X scale function (label → px). Defaults to nil.
  • y_scale (:any) - Y scale function (value → py). Defaults to nil.
  • color (:string) - Marker color. Defaults to "oklch(0.60 0.25 0)".
  • symbol (:atom) - Marker symbol shape. Defaults to :circle. Must be one of :circle, :diamond, or :triangle.
  • symbol_size (:any) - Symbol size in pixels. Defaults to 12.
  • show_label (:boolean) - Show value label on markers. Defaults to true.
  • animate (:boolean) - Enable entrance animation. Defaults to true.
  • class (:string) - Defaults to nil.
  • Global attributes are accepted.