Page MenuHomePhabricator

Select a chart library
Open, Needs TriagePublic

Description

Event Timeline

Note: If chart is client JS-only feature, it will not be shown in various places such as PDF export or apps. We need to first consider whether to render chart server side. Having a client-only feature is not really a good idea.

Note: If chart is client JS-only feature, it will not be shown in various places such as PDF export or apps. We need to first consider whether to render chart server side. Having a client-only feature is not really a good idea.

We plan to start with only rendering charts server-side, and adding client-side enhancements at a later stage.

Some other charting libraries:

  • RGraph
  • Teechart
  • Plotly.js
  • Chart.js (HTML canvas only - canvas can be easily converted to raster images, but not vector ones)
  • Mermaid
  • DataDraw (cf T338098, but seems inactive since 2023)

Another alternative is not using an existing library at all and make a service to generate SVG from stratch.

Here is some high-level criteria to consider for evaluating a library:

Must-have

  • Open source
  • Actively being developed
  • Stable and likely to be supported for a long time
  • Ability to server-render charts (preferably as SVGs)
  • Support for layering more interactivity (through CSS animations and/or JS hydration client-side)
  • Geo/map-based visualizations (minimum 2D)
  • Customizable visual design (like color palette and patterns/textures for better accessibility)
  • i18n ready (essentially, can we support multilingualism with it)
  • Intuitive / easy-to-learn syntax for building charts

Nice-to-have

  • Support for hyperlinks (so we could do things like link to articles from chart labels or descriptions)
  • Time-based animations
  • 3D visualizations

I'm not going into the details of the differences in very specific types of visualizations, like what exact interactivity and customization is possible. Obviously, plotting data on common charts like line, bar, pie, etc are the baseline. All the libraries considered above are quite powerful and support a wide range of visualization options. Most of them support the nice-to-have stuff anyway. Things like the level of support for "good" server-rendering/hydration and "intuitive" syntax matter more, but are also squishier concepts. At first glance, Apache ECharts looks promising, especially the server-side rendering and different levels of hydration.

I welcome edits/addition to this list -- I'm sure I've missed things. I anticipate we'll come up with new criteria once we start our analysis.