Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am struggling with how to handle text alignment from my hypercube. On measureinfo property there is a TextAlign property but that property value is wrong. My QlikSense object is aligning "Right" and that property is "Left". I have found a workaround where I read the entire JObject and from that pick out the Representation property which in turn contains an IndicatorProps.Position property where alignment is the correct value "Right". This is definately not how it is supposed to be done but I cant come up with any other solution. Would be forever grateful if someone has a solution for this so I can remove my custom code for fetching such a trivial design property.
Attaching some screenshots on the data
Ok, sorry, never used the actual QlikSense UI, only integrated to it. But here is the .qvf file.
Hi @andreas-hellquist-stratsys , thanks for sharing the app.
I made a couple of test and this is how product works. When Text Alignment property is set to "auto", default alignments will be applies. For text values alignment is on the left, for numbers and dates is on the right. Looking at the property with GatLayout method we will see
"textAlign": {
"auto": true,
"align": "left"
}
This means that in this particular case, the align property is not considered by the product, because "auto" prop is set to true. Could make confusion here, but this is how it works. Align is set to true beucase is the default value. Indeed, when you switch off the auto prop in the UI you will see align left set as default. See below screenshot
If I force position to right, then in properties you will see align "right"
Then, here what we have in the GetLayout method
"textAlign": {
"auto": false,
"align": "right"
}
Finally, when auto is set to true, you will know that text are on left and dates and numbers on right. When auto is set to false, then read align value.
Thank you very much for the great explanation! It was slightly confusing but now I know how to sort it out at least. Right now I just check for type of data in column and align by that.