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.