Charting library options
What follows is an options appraisal for the charting library that will be used to replace HighCharts. Although Highcharts works very well its license does not allow it to be used in a commercial or government environment without a charge. Therefore some OpenREM users will need to purchase a license. For this reason we'd like to replace the Highcharts library with an alternative that is free and open source.
|Library||Language||License||Chart types||On-line interactive charts?|
|plotly py||Python||MIT||Line, bar, scatter, boxplot etc.||Yes|
|matplotlib||Python||BSD-based||Line, bar, scatter, boxplot etc.||Yes, via plot.ly|
|Bokeh||Python||BSD 3-Clause "New" or "Revised" License||Line, bar, scatter, boxplot etc.||Yes|
|Altair 2.0||Python 3.5+||BSD 3-Clause "New" or "Revised" License||Line, bar, scatter, boxplot etc.||Yes|
|HoloViews||Python 2.7+||BSD 3-Clause "New" or "Revised" License||Line, bar, scatter, boxplot etc.||Yes|
|pygal||Python 2.7+||GNU LGPL v3+||Line, bar, scatter, boxplot etc.||Yes|
|R with Shiny||R||GNU GPL v3||Line, bar, scatter, boxplot etc.||Yes|
There's an example of pygal being used with Django here
Shiny with R looks interesting - you can have controls on the page that update the plots live. Not sure how it works at the moment. However, the open source Shiny server is only available for Linux, so I don't think we can make use of it.
If you have half an hour, this overview of the python visualisation landscape might be useful: https://youtu.be/FytuB8nFHPQ
Having watched the above video this afternoon I have added the
HoloViews rows to the above table.
Altair looks very interesting;
unfortunately it requires python 3.5 or later, ruling it out for OpenREM at the
Cube.js looks like it may be useful: https://dev.to/cubejs/cube-js-the-open-source-dashboard-framework-ultimate-guide-53be
Requirements of the charting library
- Free to use
- Charts can be saved as a graphic
- Charts can be interactive, to enable values of data points on mouse-over, for example
- Capable of aggregating data to reduce server memory when calculating multiple charts
- Preferably simple to code various chart type
- Preferable to be python-based?