render_sparkline_svg
Documentation for eth_defi.research.sparkline.render_sparkline_svg function.
- render_sparkline_svg(vault_prices_df, *, width=100, height=25, line_width=1, margin_ratio=4, line_color='#22B452', bg_color='#282827', x_axis_range=None)
Render a deterministic sparse step sparkline as native SVG bytes.
- Parameters
vault_prices_df (Union[pandas.DataFrame, eth_defi.research.sparkline.SparklineData]) – Prepared sparkline data or a finite single-vault price frame.
width (int) – SVG width in pixels.
height (int) – SVG height in pixels.
line_width (int) – Price-line width in pixels.
margin_ratio (int) – Vertical margin in pixels relative to the output height.
line_color (str) – Top colour of the translucent area gradient.
bg_color (str) – Background colour.
x_axis_range (Optional[tuple[pandas.Timestamp, pandas.Timestamp]]) – Optional explicit chart bounds for raw price frames.
- Returns
Stable UTF-8 SVG bytes.
- Return type