manuel-rubio
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.
Trending in Announcing
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #blog-post
- #ai
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 8- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
alvinkatojr
You are killling it, man! I can’t wait to dive into the source. This and press both look amazing! Good work!
MarcusRiemer
Oh, this is very interesting, thank you for your contribution! I’m currently rendering my own charts for (effectively) a distribution of outcomes for a game with dice:
Could I switch to Plotto for this? I skimmed the examples and didn’t see an option to put labels above the bars, but maybe I’m missing something. The colours in my example change whenever the distribution switches from “target damaged” to “target defeated”. I think for that I would have to pass two seperate series?
manuel-rubio
I’m using both in Conta
manuel-rubio
Done! New version 0.4.0 supports that:
Here you go. The proof:
MarcusRiemer
I started integrating Plotto and just stumbled over this: Plotto.LineChart — plotto v0.4.0
Unluckily for me I do have line charts that look like this:
I could find another way to represent same-faction series than dashing, but the multi-series line chart have been exactly the chart I wanted to move to plotto in order to be able to render them for
og:images.Any ETA on that “future release”?
manuel-rubio
Of course, but I don’t understand exactly what do you expect and what’s the issue?
manuel-rubio
Done! New version 0.5.0
MarcusRiemer
This is wonderful! I had some time yesterday and put Plotto to use at Wüstenjägerin gegen Gewitterbote · Summoners Compendium (linked page shows embedded SVG, is in german and is a technically unreleased feature that may still be buggy) and as png for the
og:image:I made minor CSS tweaks to show labels and axis even in darkmode:
Asking you for features has been so scarily effective, that I am almost hesitant to propose more. Please don’t feel pressured, these are things that would delight me, but I am very happy as is:
<title>on circles), in my case this would be a%.