dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #37141
Re: Questions regarding Embedding charts with the Visualizer chart plug-in
For now you can of course update to the latest 2.18 and include the plugin
from <server>/dhis-web-commons/javascripts/plugin/chart.js
Jan
On Thu, Apr 23, 2015 at 3:44 PM, Jan Henrik Øverland <
janhenrik.overland@xxxxxxxxx> wrote:
> Just updated the 2.18 plugin with a new config option "displayProperty"
> which could be set to "shortname" (case insensitive).
>
> I can see that the cdn has not yet been updated. Guess we just have to
> wait. Will let you know.
>
> On Wed, Apr 22, 2015 at 7:02 PM, Bharath <chbharathk@xxxxxxxxx> wrote:
>
>> Sorry for many questions...but functionality is very nice and very much
>> useful for apps and even HTML reports.
>>
>> One more question :-)
>>
>> In charts we are displaying names as rows / columns ( categories /
>> series). Is is possible to display shortnames by setting any parameter
>> because some dataelements are having very longish names especially if it
>> includes catecory option combo name.
>>
>> Thanks for you support.
>>
>>
>>
>>
>>
>> On Wed, Apr 22, 2015 at 1:46 AM, Bharath <chbharathk@xxxxxxxxx> wrote:
>>
>>> Thanks for the Tip. looked into Embed option, worked smoothly,
>>>
>>> Parameter changes are:
>>> -Dimension is dc instead de and
>>> - iteams are dataelementuid#cocuid instead dataelementuid
>>>
>>> Thanks Jan.
>>>
>>>
>>> On Wed, Apr 22, 2015 at 1:35 AM, Jan Henrik Øverland <
>>> janhenrik.overland@xxxxxxxxx> wrote:
>>>
>>>> Will look at it tomorrow, but a trick is to open the DV, create the
>>>> chart you want to see and select Share -> Embed in web page from the
>>>> toolbar to see the config.
>>>> On Apr 21, 2015 9:57 PM, "Bharath" <chbharathk@xxxxxxxxx> wrote:
>>>>
>>>>> 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
>>>>>
>>>>
>>>
>>>
>>> --
>>>
>>> Regards,
>>> Bharath Kumar. Ch
>>>
>>
>>
>>
>> --
>>
>> Regards,
>> Bharath Kumar. Ch
>>
>
>
Follow ups
References