Server-side SVG renderer for AshDyan.Result.
Produces a standalone <svg> string (no JavaScript, no external assets) so a
result can be rendered to an image in emails, PDFs, or any non-JS context.
The visual conventions (palette, chart-type defaults) match
AshDyan.Charts.to_chartjs/2 / to_echarts/2.
Supported chart types
:bar— vertical bars, one group per label, one bar per series.:line— polylines with point markers.:area— like:linewith a translucent fill under each series.:pie/:donut— single-series slices (donut has an inner radius).:histogram— contiguous bars (no gaps between bins).:scatter— paired two-series points, or per-series points at index x.
chart_type is optional; AshDyan.Charts.recommend/1 is used when omitted.
Example
{:ok, result} = AshDyan.run(spec)
svg = AshDyan.Charts.to_svg(result)
# or: AshDyan.Charts.to_svg(result, :line, width: 800, height: 400)Options
:width— SVG width in px (default640).:height— SVG height in px (default400).:title— chart title text (defaultnil).
Summary
Functions
Render a result as a standalone SVG string.
Types
@type option() :: {:width, pos_integer()} | {:height, pos_integer()} | {:title, String.t() | nil}
Functions
@spec render(AshDyan.Result.t(), AshDyan.Charts.chart_type() | nil, [option()]) :: {:ok, String.t()} | {:error, AshDyan.Error.t()}
Render a result as a standalone SVG string.