Embedding DHIS2 Visualizations


Below the challenges we have encountered in our efforts to embed DHIS2 visualizations in a third-party website. Due to several obstacles, we have concluded that it is not feasible to embed the visualizations without significant effort and resources.
The main reasons for this conclusion are as follows:

  • Removal of "embed" feature: DHIS2 has eliminated the "embed" feature from the visualizations app, which previously facilitated the generation of the necessary HTML and JavaScript code for Chart.js. This change may be associated with their recent transition to the HighCharts library.
  • Ineffectiveness of iframes: We explored the possibility of using iframes as a low-overhead solution. However, modern web security standards and DHIS2's security features prevent third-party/cross-origin client authentication, rendering this workaround unworkable.
  • Extensive customization required: Displaying data in charts and visualizations within DHIS2 is possible, but would necessitate significant customization, development, and coordination with the MOH. The long-term maintenance costs for such a solution may
  • An alternative is to use a BI tool to embed visualizations (powerBI, Tableau, Metabase [open source]).

To be clear, it is possible to visualize DHIS2 data outside of DHIS2 using the same charting library and data from DHIS2’s analytics API. That solution is very large in scope and needs to be budgeted for long term maintenance as well as a close partnership with the end user (depending on how it is hosted). Consult the https://baosystems.atlassian.net/wiki/spaces/ARB for more information.


Related articles