Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
Francis_Kabinoff
Former Employee
Former Employee

UPDATE -  There is no longer any reason to do it this way. Beginning with Qlik Sense 3.0, we now have the noSelections option - App API and Viz API noSelections option‌.

I've come across the need a few times now to embed a chart or two into a website with selections disabled. This is the default behavior when embedding Qlik Sense Cloud charts, but what about if you want to do it using charts from a Qlik Sense app using the Capability APIs? Let's take a look at two different methods for achieving this.

Method 1: Using the noInteraction option in the getObject() method

The getObject() method takes an optional options parameter which allows you to set noInteraction to true.

app.getObject("QV01", "objID", {"noInteraction": true});

This will disable selections on the chart, however, it will also disable tooltips and scrolling, which is often undesired. Take a look at an example here http://webapps.qlik.com/no-interaction-chart-example/method1.html and notice how you are unable to scroll to see the whole chart, and the chart's tooltips do not work.

Method 2: Select all and lock field

So what I do to disable selections in a chart embedded with the Capability APIs is to use the selectAll() and lock() methods from the Field API on the field of the dimension in the chart. For instance, if the chart's dimension is the Date field, I would do the following

app.getObject("QV01", "hRZaKk");

app.field("Date").selectAll();

app.field("Date").lock();

This effectively disables selections on the chart by not allowing any selections on the field this chart is using as a dimension. Scrolling and tooltips still work, as you can see in the example http://webapps.qlik.com/no-interaction-chart-example/method2.html

There is a drawback to this method. If, for example, you wanted to embed 2 objects on a page that both used the same dimension, but disable selections in only one of them, this method would disable selections on both. But for many cases, this method will work just fine.

2 Comments
mgranillo
Specialist
Specialist

Thanks, very helpful post. 

1,561 Views
markginqo
Partner - Contributor III
Partner - Contributor III

Thanks Francis, especially for taking the time to come back and post a link to the newer method you outlined in your App API and Viz API noSelections option article...

0 Likes
1,561 Views