Thanks Tharik!

Updated my wso2-widget WC to use VizGrammer, but it seems we have a bunch
of document.getElementById()s which is not going to search inside shadow
roots. So this is not going to work :( . Let me look into other
alternatives.

On Thu, Mar 23, 2017 at 12:11 PM, Tharik Kanaka <tha...@wso2.com> wrote:

> Hi Udara,
>
> Igviz library is no longer used and we have replaced that with VizGrammar.
> In VizGrammar you can use draw() function to draw the chart in a div. If
> you want to insert records to update the chart you can use insert(). You
> can try samples [1] and all the library content along with samples are
> available in  github repository [2].
>
> *var data = {*
> *  "metadata" : {*
> *      "names" : ["rpm","torque","horsepower", "EngineType"],*
> *      "types" : ["linear","linear", "ordinal","ordinal"]*
> *  },*
> *  "data": [*
> *    [1, 10, 1, "Piston"],  [2, 12, 5, "Piston"]]*
> *};*
>
> *var config = {*
> *    charts : [{type: "area",  x : "rpm", y : "torque"}],*
> *    maxLength: 10,*
> *    width: 400,*
> *    height: 200*
> *}*
>
> *var chart = new vizg(data, **config**);*
>
> *chart.draw("#chartDiv");*
>
> *chart.insert([[8000, 74, 120, "Rotary"]]);*
>
> [1] http://wso2.github.io/VizGrammar/samples/
>
> [2] https://github.com/wso2/VizGrammar/
>
> Thanks,
>
>
> On Thu, Mar 23, 2017 at 11:42 AM, Udara Rathnayake <uda...@wso2.com>
> wrote:
>
>> Hi all,
>>
>> I'm trying to create a web component (wso2-widget) to try-out
>> capabilities which we can incorporate in to our widget rendering framework.
>>
>> ​Within my renderWidget function[1] I'm using the usual igviz.plot but
>> unable to draw the chart inside container element which exists inside a
>> shadow-root.​ Did some debugging but unable to find the place which
>> breaks(No errors too).
>>
>> ​Appreciate any feedback on this.​
>>
>> PS:- If you need to try out this, host the source within "wc" branch
>> inside apache2 and use Google chrome.
>>
>> ​[1] https://github.com/udarakr/uuf-sample-gadget/blob/wc/wso2-
>> widget/wso2-widget.comp.html#L121
>>
>> --
>> Regards,
>> UdaraR
>>
>
>
>
> --
>
> *Tharik Kanaka*
>
> WSO2, Inc | lean . enterprise . middleware
>
> Email: tha...@wso2.com | Web: www.wso2.com
>



-- 
Regards,
UdaraR
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to