I’m excited to introduce you to Plotto, a chart library created in 100% Elixir that generates SVG and PNG images. Yes, it’s not only generating SVG for interactive use in combination with LiveView, but you can also generate directly to PNG with the same image and send it vía email, Telegram, Slack, or whatever you need.
Plotto is a plot library, 100% Elixir, that’s focused on generating beautiful SVG charts and exporting the same chart to PNG when it’s needed — including the PNG rasterizer and TrueType font renderer, no external binaries or NIFs required.
It is very useful when you are developing a website and need to integrate SVG charts. Chart data items accept arbitrary HTML/SVG attributes (
phx-click,data-*, etc.), so if you are using Phoenix LiveView you can attach events, actions, and feedback to individual bars/points — without Plotto depending on Phoenix or LiveView in any way.If you need to export or generate PNG charts for email, PDF, or sending via Telegram, Slack, Mattermost, etc.,
Plotto.to_png/1renders the same chart to a PNG binary, anti-aliased and with full Unicode text support (including accented characters like á, é, ñ) via a bundled DejaVu Sans font.Charts can also show an optional title and a legend (one color swatch + name row per series), positioned in any of the four corners — see
:titleand:legendinPlotto.BarChartorPlotto.LineChart. Negative values and mixed positive/negative domains are fully supported with an automatic zero baseline.
It was created to be introduced in the project Conta.




























