How to integrate Altair Plot into PDF report

Hi everyone,

I’m new to KNIME and still learning Python and R. I’ve been developing some plots using Altair in Python and R ggplot2, and I’m happy with the results. However, I want to integrate these plots into a KNIME PDF report, but I’m running into issues.

Altair renders the plot in HTML format, and when I use a Python View Node, it works. When I convert the Python View Node into a Component, it shows the message: “This view is not supported.”

I understand that KNIME PDF reports require static images (PNG, SVG, or JPEG), but I prefer to use Altair instead of Matplotlib or any other.

Does anyone know a way to export Altair charts as static images (PNG/SVG) within KNIME so they can be used in a PDF report?

Thanks in advance for your help!

Hello @guillem_furio,

Since you are using Python, have you tried to save the Altair charts as an image via Python Script? You can then read those images in by providing the path to where you saved them

Here is the sample workflow I made showing how to save altair images:

The code I used can be found in the python script.

Hope this helps,
TL

4 Likes