Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
This is actually a bug report. Please move to different category, or tell me where to open bug reports.
Motivation
I am working on Qlik charts that are embedded in a website as mashups.
I am preparing a special print view, where I have to scale the charts to fit into the page without any horizontal scrolling.
I am trying to achieve this with `transform: scale(..)`on the element that contains a Qlik chart.
Problem
When I apply `transform: scale(factor)`, when Qlik redraws the element (e.g. on resize event), the chart is actually resized by the square of that factor. E.g. scale(.5) results in a resize that is more like scale(.25).
Steps to reproduce
I found an online demo where this can be reproduced easily.
https://webapps.qlik.com/masters/index.html#/stats
Expected: Pie chart stays at 50% size after redraw.
Actual: Pie chart appears at 25% size after redraw.
Technical explanation
On redraw, Qlik recalculates the positions and sizes of canvas and svg elements inside an `.ng-scope` wrapper.
For some reason, these calculations get confused if a parent element has transform: scale() on it.
Workaround with limitations
As a workaround, I am now trying to scale the parent only by the square root of the actual factor. E.g. if I want to scale by .64, instead I apply transform: scale(.8).
However this has some problem because not all elements are resized in this bad/squared way.
E.g. some of the charts are actually html tables, and these will only be resized by the correct scale factor.
Trying to target exactly the elements that need the special scale factor is tricky, because there are no good selectors to distinguish the different types.
From https://community.qlik.com/t5/New-to-Qlik-Sense/How-to-report-a-bug/td-p/1076062
Or start a discussion in the Qlik Sense space and try to attract the attention of a Qlik employee like Dirk Scharffetter, Jeffrey Goldberg, Mattias Malre orMichael Tarallo
So.. ping 🙂
Hi @donquixote
This was previously reported as QB-775 to Qlik R&D but closed with no resolution.
Please feel free to log an idea in Qlik ideation so that other customers interested in this can vote on it.
https://community.qlik.com/t5/Submit-an-Idea/ct-p/qlik-ideationsubmit
Hello,
the link gives me this:
Perhaps I don't have enough privileges.
Trying to access the Support Case Portal? or Downloads page? Connect with an agent now via live chat (click help icon lower right of page)
Product issue? Please post a question in one of our many product forums [https://community.qlik.com/t5/Forums/ct-p/Forums] or create a case with Qlik Support [https://community.qlik.com/t5/crmsupport/page]
Btw for the time being I used a workaround:
This way the charts are never redrawn while transform: scale() is active. Qlik js never sees the page with print CSS applied.
All of this is to make sure that all labels show up in print.
But, this workaround is not ideal.
So is there a better workaround or fix yet? I still got this issue.