Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
I am exploring the creation of custom visualisations, using the capability API.
I am facing a problem when creating a dynamic pivot table.
define(["qlik"
],
function (qlik) {
return {
support: {
snapshot: true,
export: true,
exportData: false
},
paint: function ($element) {
$element.html("<div qv-extension id='myTable'></div>");
var app = qlik.currApp();
var options = {
qHyperCubeDef: {
qSuppressZero: true,
qMode: "P",
qShowTotalsAbove: true,
qIndentMode: true,
qAlwaysFullyExpanded: false,
qNoOfLeftDims: 2,
qInitialDataFetch: [{
qWidth: 2,
qHeight: 1000
}]
},
title: 'My code generated pivot-table'
};
var selectedFields = [
{qLibraryId: "jpgm", qType: "dimension"},
{qLibraryId: "RXHnxGJ", qType: "dimension"},
{qLibraryId: "XzkbUQj", qType: "measure"},
{qLibraryId: "PVkSbPD", qType: "measure"}
];
app.visualization.create('pivot-table', selectedFields, options).then(function (visual) {
window.visual = visual;
visual.show('myTable');
});
//needed for export
return qlik.Promise.resolve();
}
};
});
This renders a chart that has a container with no height and therefore, the chart does not show up unless if i force a height to it. And still, it only shows one row.
Why does this happen?
Thank you for the help!
Hi,
As far as I know you need to set a height.
Erik Wetterberg
A hard-coded height? as in css? or in the properties?
Since Qlik Sense visualizations will fill the element you give them, you need to set the size with css.
Erik Wetterberg