Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
All,
I am trying to use the Engine API to add a new bar chart to a certain sheet using the CreateChild method. According to the return message, the new object is successfully created and is enlisted in the object list of the sheet when calling ChildInfos on the sheet. The problem is however that the object is not showing up in the actual Qlik Sense app.
So my question is: how can I make the new bar chart, which is a part of the sheet, appear in the Qlik Sense app? Is there any visibility setting I should set? And how can I specify where it should be shown on the sheet and with which physical dimensions?
Inside an extension or in a website integration, this is all rather straightforward as you can include the object directly in the html definitions.
Thanks in advance,
Gregory
On the sheet object there is a full dynamic property called "cells" which is an array of the different sheet objects.
Example:
{
"name": "KxdNL",
"type": "gauge",
"col": 1,
"row": 0,
"colspan": 6,
"rowspan": 4
}
You would have to perform some collision detection with the objects already placed on the sheet so they do not occupy the same grid cell.
On the sheet object there is a full dynamic property called "cells" which is an array of the different sheet objects.
Example:
{
"name": "KxdNL",
"type": "gauge",
"col": 1,
"row": 0,
"colspan": 6,
"rowspan": 4
}
You would have to perform some collision detection with the objects already placed on the sheet so they do not occupy the same grid cell.
Alexander,
Thanks once again. I managed to change the cells property and the charts are showing up on the correct position.
Kind regards
Gregory
How did you change the Cells property on the Sheet object using engine api?
You can use applyPatches:
{ "handle": 3, "method": "ApplyPatches", "params": { "qPatches": [ { "qOp": "add", "qPath": "/cells", "qValue": "[{ \"name\": \"MUJjf\", \"type\": \"barchart\", \"col\": 1, \"row\": 0, \"colspan\": 22, \"rowspan\": 3}]" } ], "qSoftPatch": false }, "outKey": -1, "id": 14 }
can you share a sample of the json with which you created the bar chart thats can be visible on the sheet ?
and also can you tell me how to change the dimensions of the same bar chart using applyPatches method?
The bar chart was created on the sheet with something like this:
var apiMsg = {
"handle": handle,
"id" : id,
"method": "CreateChild",
"params": {
"qProp": barchartProperties
}
};
where barchartProperties was queried from the session object using
var apiMsg = {
"handle": handle,
"id": id,
"method": "GetEffectiveProperties",
"params": {}
};
I don't know how to change the qlik dimensions of the chart, if you mean physical dimensions then that's controlled by rowspan/colspan in the first call.