Skip to main content

Integration, Extension & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Welcome to Qlik Community! Check out our new navigation! FIND OUT MORE
Showing results for 
Search instead for 
Did you mean: 
Partner - Contributor II
Partner - Contributor II

Embed Qlik Sense Chart with Capability API, losing any kind of css


I have an app all set up to connect to Qlik's Capability API and I already am doing things with it.    Although so far, I am embedding Qlik Sheets using the singles API, with Iframes.     I lose some chart functionalities this way, and I would like to load the charts of a sheet using the Capability API, have more control on things I can do. 

My problem is that when I load a chart using app.getObject, I see the title on the page, I see all the html code in the Dom, but nothing shows.   It's like there is no css applied whatsoever.   

I tried applying a theme I have, to no avail.  I tried referring to Qlik's css, in the resources folders, but they are expecting to have the base href pointing at the Qlik server. 

I am trying to look at how mashups are doing it, but it gets back to their base href.    I don't know how to work with mashups, and anyway, I want the whole sheet displayed, not just 2 or 3 charts. 

Is there any way I can load charts, using app.getObject() and have it displayed in the same styling that I see in Qlik?  

Labels (3)
2 Replies

Without a mashup that can hold each chart one by one, you can only embed a full sheet with iFrame, however this will look exactly like Qlik Sense native Hub client. 

Can you let us know more specifically how you tried to reference the Qlik Sense CSS files? They can also be copied to a different web server that you can point your code to for loading these static files. 

In order to exclude any permission / security rule interference, can you try to embed a single object from an app, by right-clicking on the object via the Hub? 

Partner - Contributor II
Partner - Contributor II

In my app, I already load sheets in Iframes.  I have apps with many sheets in them, but I handle the navigation in a custom way, and manage it with loading the sheets through the singles API. 

In order to log users in seemlessly, I also start a session using the capability api, loading the hub in the background to have Qlik create the session and opening the app through the capability API, and using enigma in my app's backend also.  This also allows me to handle selections throughout the sheet navigation and a bunch of other things in a custom way.   

Anyway this all works good.  Though I am losing some features that a full app in-qlik possess (which my users want).   I am regaining some of them by writing some small extensions to manipulate things with jquery, might be a hack, but it works. 

So I am trying to see if I could load charts directly in divs, now, and have more control on my side of things, instead of dealing with iframes, or having to mess with extensions. 

Instead of having mashups, since I already have the app opened in Capability API, I was trying to load object using app.getObject(divId, objId).   This puts the object on screen alright, but not showing anything.  Which I assume is because I don't have the css, and probably don't have the javascript to run the charts either.     I was trying to reference the qlik css from the 'resources' path on the qlik server, but the css I found are referencing Qlik fonts as relative paths, which renders the css unusable, or if I copy the css locally, I would need to copy all the resources also.  that is starting to be complicated for not much. 

So far, I thought mashups were a buildup of a bunch of charts, but from what you say, it's more aimed at having only 1 or very few charts. 

What I don't really know is, mashups from what I can see have all the full html code in them, so how would I refer to all those mashups from my app?  Iframes? that defeats the purpose I am after. 

I seem to be stuck between Qlik that is supposed to work in certain ways, and managers that want to have it work as if it would be my own code / control. 

In anycase, as I said right now, I am dealing around the issues with extensions and jquery