The charting library behind a company's dashboards is a long-term decision. It sets how quickly new decision products can be built, how good they look on a phone in a board meeting and how much it costs to maintain them. To compare the options on equal terms, we built the same chart with three of the best open-source libraries available in Python.

The test chart is typical of an executive dashboard: a stacked area chart over time, with a date range selector, totals that update with the selection and an interactive legend.

Plotly: fast to start, harder to finish

Plotly is one of the most popular libraries for interactive charts in Python, well integrated with Pandas and notebooks. Plotly Express produced the base chart in a few lines, but reaching the executive standard required workarounds:

  • The vertical axis does not rescale when the date range changes, which hides patterns in shorter periods.
  • There is no built-in way to show totals that react to the legend; we added them with JavaScript.
  • Interacting with the legend removes the fill colour of the areas, a known bug.
The final Plotly chart: useful and interactive, with workarounds.

Altair: elegant grammar, more code

Vega-Altair describes charts declaratively, on top of the Vega grammar, and is excellent for statistical graphics. The interaction took more code than the design, and some limitations remained:

  • With several legend items selected, clicking the chart or the selector clears the last selection; compiling the chart to Vega fixed it.
  • The date selector does not work well on mobile devices, and tooltips can stay stuck on screen.
  • Faceted charts cannot size themselves to their container.
The final Altair chart: useful and interactive, less suited to mobile.

ECharts: the most complete result

ECharts is an open-source JavaScript library built for performance and flexibility, with a very wide range of chart types. PyEcharts gives access to it from Python. It needed the least code of the three, worked on mobile without changes, and its only gap, totals that follow the legend, took a few lines of JavaScript.

The final ECharts chart: complete, interactive and mobile-ready.

Our recommendation

  • Plotly is a strong choice for analysis in notebooks and quick prototypes; production dashboards will need workarounds.
  • Altair is ideal for statistical exploration by analysts, less so for mobile executive use.
  • ECharts is our choice for decision products: complete out of the box, fast, mobile-ready and easy to extend.
BS

Bartor S.

Founder

All insights