Qlik Community

Qlik Sense Integration, Extensions, & APIs

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

rbartley
Valued Contributor

Qlik Sense Mashup API - Detecting Calculation Condition

Dear all,

I would like to display a message below my line chart, but only if the calculation condition has been met, i.e. the chart is displayed and not the custom message.  I have been able to determine that Qlik uses the class "object-error" for the div that shows the 'error' and so I am using the following code:

app.createList({

"qDef": {

"qFieldDefs": [

"[Marketing Year]"

]

},

"qInitialDataFetch": [{

qTop : 0,

qLeft : 0,

qHeight : 100,

qWidth : 1

}]

}, function(reply) {

console.log('Marketing Year changed');

changeVisibilityAxisLabel();

});

.......

function changeVisibilityAxisLabel()

{

var intErrorMessage = $('.object-error').length;

if(intErrorMessage!=0)

{

$('#imgLineYearComparisonAxisLabel').hide();

}

else

{

$('#imgLineYearComparisonAxisLabel').show();

}

}

However, I wonder whether there is  better way, since I am having to use a timeout to cope with the synchronisation issues between the filter being selected and the chart updating to display the chart or error message.

Tags (1)
Community Browser