Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Engine API: CreateChild not visible in app

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

1 Solution

Accepted Solutions
Alexander_Thor
Employee
Employee

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.

View solution in original post

6 Replies
Alexander_Thor
Employee
Employee

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.

Anonymous
Not applicable
Author

Alexander,

Thanks once again. I managed to change the cells property and the charts are showing up on the correct position.

Kind regards

Gregory

mborsadw
Partner - Creator
Partner - Creator

How did you change the Cells property on the Sheet object using engine api?

JFico_Bardess
Partner - Contributor
Partner - Contributor

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
}

 

 

nitinsaivishnu1
Partner - Contributor II
Partner - Contributor II

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?

JFico_Bardess
Partner - Contributor
Partner - Contributor

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.