Using both libraries the charts display fine, locally in dev.
What doesn’t work:
Non-Latin data (title, labels) are displayed as unicode. In plotly also <br> tag displayed as unicode (which means the issue is not necessarily about the language).
MemoryError when deploying to a server (tested Plotly), pointing at the line with fig=fig.to_html(). (I am not using much data, it is a simple chart.)
The fact that the issue (unicode characters) repeats for both libraries probably means that the cause lies with Django.
Question:
How to embed interactive charts directly in Django minding international users with non-Latin data?
Means in chart it would display something like “\u031f\u0435…” for a German word “für”. And something like “\u003cbr\u003e” for <br>, i.e. where there should be a new line in hover labels. Then labels appear on the same line with “\u003cbr\u003e” in between.
Looks like {{ fig|safe }} already receives data in this format “\u..”
By the way, I also generated a static version of the chart with Plotly and it looks fine (non-Latin text appears correct). When generating a static chart what gets omitted in code is fig=fig.to_html() and {{ fig|safe }}.