Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 146
Registered: ‎07-03-2013
My Device: BB 9360
My Carrier: WIND

Import 3rd Party JS Lib to Draw Graphs

Hello, 
I was just wondering, does anyone have any idea as how can we use a pure JS chart library in QML to draw charts. 

The following is what I am doing 

 

import "highstock.js" as HighStock

 But When I call methods in the Javscript, something like:

HighStock.highcharts(....)

 I always get error something like:

'HighStock.highcharts' [undefined] is not a function.

 However, there is a function in the Javascript src file. 

 

Also, in some of the libraries, they call "$('#container')....." where "#container" is the place where they will be outputting the graph. How can we output in QML, because I dont think we can use JQuery here.

 

Thanks

 

Developer
Posts: 828
Registered: ‎10-16-2012
My Device: Red Z10
My Carrier: Rogers

Re: Import 3rd Party JS Lib to Draw Graphs

You can use these javascript librariers and JQuery in a cascades webview here's a few articles that go over how to go about making a hybrid app

 

http://devblog.blackberry.com/2014/01/hybrid-apps-for-blackberry-10-creating-a-webview-based-qml-com...

 

http://devblog.blackberry.com/2014/01/hybrid-apps-for-blackberry-10-an-introduction/