Errors with embedding charts and tables on a webpage using Data Visualizer

I created a chart using the data visualizer app and clicked the ‘Embed’ link to copy the HTML code for the chart. .

I replaced username & password with my login username and password, for example: ‘fruity’ & ‘elephant’. I’m not sure about the url to server, I just put the url for the dhis2 we are working on https://dhis2.fred-sdfff.ng.

when I try and run the code in my computer nothing shows. On the console I get 2 errors

  1. Failed to load resource: the server responded with a status of 404 ()
    https://dhis2-cdn.org/v230/plugin/chart.js

  2. Uncaught ReferenceError: chartPlugin is not defined at dhis2.html:12 (the line where chartPlugin.url is)

Any assistance will be appreciated

1 Like

Hi @styles,

Kindly check out this thread and let us know if it answers your need; Problems Embedding DHIS Tables and Charts

Best,
James.

1 Like

Thanks for your response. The other post helped me with finding the correct scripts but it didn’t solve my entire problem

In this part of the code. chartPlugin.url = “url to server”;

What is the url to the server? Is it the url to the dhis2? I put the url of the dhis2 I’m working on and I recieved an error on the console:

Uncaught ReferenceError: chartPlugin is not defined
at dhis2.html:12

1 Like