← Back to team overview

dhis2-devs team mailing list archive

Re: Questions regarding Embedding charts with the Visualizer chart plug-in

 

Hi Jan,

Charts for the dataelements which are of type default categorycombo are
working fine. How can I embed chart for the dataelements which are having
categories, for ex:- chart for dataelement Number of fever cases which is
having Male and Female as category combo options. Can you please help on
which parameters to pass for category option combos.




On Mon, Apr 20, 2015 at 6:49 PM, Jan Henrik Øverland <
janhenrik.overland@xxxxxxxxx> wrote:

> Great. I just updated the CDN (2.18) so "legendStyle" and "hideEmptyRows"
> shoud be unnecessary by now.
>
> On Mon, Apr 20, 2015 at 3:10 PM, Bharath <chbharathk@xxxxxxxxx> wrote:
>
>> Thank you so much Jan, it worked perfectly. Thanks
>>
>> On Mon, Apr 20, 2015 at 6:28 PM, Jan Henrik Øverland <
>> janhenrik.overland@xxxxxxxxx> wrote:
>>
>>> Hi Bharath,
>>>
>>> 1) I don't think this is affected by the "hideLegend" option. Please add
>>> the "legendStyle" object I mentioned ealier for now until the plugin is
>>> updated.
>>>
>>> 2) This is behind the scenes the same option as in pivot table:
>>> "hideEmptyRows". This option should be false by default, but I can see that
>>> it is not in the 2.18 plugin for some reason. I will fix this, but for now
>>> you can add "hideEmptyRows": false to your chart config to show empty
>>> categories in the chart.
>>>
>>> 3) You can override anything in a favorite by adding it to the config
>>> object. If you have periods as categories you can do e.g.:
>>>
>>> DHIS.getChart({
>>>     url: base,
>>>     el: "chart1",
>>>     id: "R0DVGvXDUNP",
>>>
>>>     legendStyle: {},
>>>     hideEmptyRows: false,
>>>     rows: [
>>>         {
>>>             dimension: "pe",
>>>             items: [
>>>                 {id: "2012"}, // Iso code for years. If you want months
>>> e.g. January 2015 would be "201501".
>>>                 {id: "2013"},
>>>                 {id: "2014"},
>>>                 {id: "2015"}
>>>             ]
>>>         }
>>>     ]
>>> }
>>>
>>> Hope this helps. Let me know if there is anything else. The plugins have
>>> a lot more options than you will find in DV so I will document it as soon
>>> as possible.
>>>
>>> Jan
>>>
>>>
>>> On Mon, Apr 20, 2015 at 9:45 AM, Bharath <chbharathk@xxxxxxxxx> wrote:
>>>
>>>> Hi All,
>>>>
>>>> Have been trying to embed charts in HTML report using Visualiser chart
>>>> Plug-in. I am facing below issues, could you please help: I am using 2.18
>>>> version.
>>>>
>>>>
>>>> 1. When I set *hideLegend *attribute value to *false* then I am
>>>> getting the below error at browser console: *Uncaught TypeError:
>>>> Cannot read property 'labelMarkerSize' of undefined*
>>>>
>>>> 2. In my chart I am passing periods 2007 to 2015 where I have data for
>>>> 2 years only, in my chart I am getting chart for those 2 years only, where
>>>> as I would like chart for all years. Can you please help if I can set any
>>>> parameter to get this. If I am generating the chart in Visualiser there I
>>>> have the option *Hide empty categories, *do we have similar option in
>>>> plug-in.
>>>>
>>>> 3. I created a chart and saved as a favourite. I am able to embed this
>>>> chart using plug-in
>>>>
>>>>  DHIS.getChart({ url: base, el: "chart1", id: "R0DVGvXDUNP" });
>>>>
>>>> I need to pass Period as parameter to this chart, can you please
>>>> suggest how can I do that.
>>>>
>>>> Thanks
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> Regards,
>>>> Bharath Kumar. Ch
>>>>
>>>> _______________________________________________
>>>> 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
>>>>
>>>>
>>>
>>
>>
>> --
>>
>> Regards,
>> Bharath Kumar. Ch
>>
>
>


-- 

Regards,
Bharath Kumar. Ch

Follow ups

References