← Back to team overview

dhis2-devs team mailing list archive

Re: Embed chart - 2.24

 

Hi Pooben,
Thanks for you answer. The problem is when i click "embed" on a given graph
I get something like this:

<html>
<head>
<link rel="stylesheet" href="
http://dhis2-cdn.org/v224/ext/resources/css/ext-plugin-gray.css"; />
<script src="http://dhis2-cdn.org/v224/ext/ext-all.js";></script>
<script src="http://dhis2-cdn.org/v224/plugin/chart.js";></script>
</head>

<body>
<div id="chart1" style="width:700px; height:400px"></div>

<script>

Ext.onReady(function() {

DHIS.getChart({
  "id": "pNxjHhHRy6Y"
});

});

</script>

</body>
</html>

First problem is none of the referenced JS or CSS file exists at the given
url, and I'm not sure what to replace them with. The closest thing I can
find API wise looks to be the 2.22 file (
http://dhis2-cdn.org/v222/plugin/chart.js)

I also suppose I need to send a user password somewhere ?

Your code looks like what is needed to generate a "new/custom" chart - I
just want to embed an existing one.

Martin

On Wed, Aug 30, 2017 at 8:40 AM, Pooben Dass <pooben@xxxxxxxx> wrote:

> Hi Martin
>
> What error are you seeing in the browser console?
>
> can you try this ?
>
> DV.plugin.getChart({
> url : base,
> el : 'chart1',
> type : 'bar',
> columns : [ {dimension : 'in',items : [ {id : '?? } ] } ],
> rows :  [{dimension : 'ou',items : x } ],
> filters : [ {dimension : 'pe',items : [ {id : period} ]} ],
> showData : true,
> });
>
> Regards
> Pooben
>
> On Mon, Aug 28, 2017 at 4:32 PM, Martin Van Aken <martin@xxxxxxxxxxxxxxxx>
> wrote:
>
>> Hi,
>> I'm trying to embed chart using a 2.24 version. Jan did help me a while
>> ago with a 2.22 version, but when I go to the doc for the 2.24 it does not
>> look up to date - https://docs.dhis2.org/2.24/
>> en/developer/html/dhis2_developer_manual_full.html#d7652e7049. From the
>> CDN it looks like there is no JS package there for 2.24 -
>> https://dhis2-cdn.org/
>>
>> Is the JS code the same than for 2.25 or 2.22 (the two closest versions
>> where there is something on the CDN?). Has anyone a running example of an
>> embed on 2.24 ?
>>
>> Thanks,
>>
>> Martin
>>
>> --
>> *Martin Van Aken - **Freelance Enthusiast Developer*
>>
>> Mobile : +32 486 899 652
>>
>> Follow me on Twitter : @martinvanaken <http://twitter.com/martinvanaken>
>> Call me on Skype : vanakenm
>> Hang out with me : martin@xxxxxxxxxxxxxxxx
>> Contact me on LinkedIn : http://www.linkedin.com/in/martinvanaken
>> Company website : www.joyouscoding.com
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~dhis2-devs
>> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~dhis2-devs
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>
> *This message and any attachments are subject to a disclaimer published at
> http://www.hisp.org/policies.html#comms_disclaimer
> <http://www.hisp.org/policies.html#comms_disclaimer>.  Please read the
> disclaimer before opening any attachment or taking any other action in
> terms of this electronic transmission.  If you cannot access the
> disclaimer, kindly send an email to disclaimer@xxxxxxxx
> <disclaimer@xxxxxxxx> and a copy will be provided to you. By replying to
> this e-mail or opening any attachment you agree to be bound by the
> provisions of the disclaimer.*
>



-- 
*Martin Van Aken - **Freelance Enthusiast Developer*

Mobile : +32 486 899 652

Follow me on Twitter : @martinvanaken <http://twitter.com/martinvanaken>
Call me on Skype : vanakenm
Hang out with me : martin@xxxxxxxxxxxxxxxx
Contact me on LinkedIn : http://www.linkedin.com/in/martinvanaken
Company website : www.joyouscoding.com

Follow ups

References