Darren Gosbell on 30 Oct 2019 08:31:25
Currently when you use a column or measure with a category of imageUrl that has an svg image Power BI ignores the aspect ratio defined in the view box for the image and draws the image in an arbitrary square. It would be great if imageUrl would allow for rectangular images. In the case of svg this could be read from the viewbox attribute.
This would allow for the creation of dynamic databars and sparklines and other creative visualizations without having to write a full blown custom visual.
- Comments (9)
- Merged Idea (3)
RE: Allow for rectangular imageUrl sizes in matrix and table visuals
When creating SVG visuals using measures the container is always 1:1 ratio, which makes it very impractical for using in more concise tables as the row size is blown up to see the visual. For i.e. svg sparklines, bullet charts, whatever, it would be good to have other ratios possible, ideally fully custom.
RE: Allow for rectangular imageUrl sizes in matrix and table visuals
Allowing a custom height and width (rather than default square aspect ratio) for SVG in tables and matrices would open up huge possibilities for micro charts as demonstrated here: https://kerrykolosko.com/building-a-custom-gauge-table-with-html/
RE: Allow for rectangular imageUrl sizes in matrix and table visuals
I've been looking at adding a custom column in a table which would use SVG to produce a visual. The ideal shape for this is no taller than the text, but quite wide.It seems that Power BI insists on allocating a square-shaped piece of space for the image to fit in. This means that when the visual is sized to the correct width, the allocated vertical space is wasted, and makes the rows much too tall.If I could set the correct width along with the height, this would solve my problem as the generated visual would always be the same (very not square) width and height. Power BI could allocate only the specified space.
RE: Allow for rectangular imageUrl sizes in matrix and table visuals
This is an absurd limitation by MS not thinking how people might want to use this capability.
RE: Allow for rectangular imageUrl sizes in matrix and table visuals
regardless of how an image is displayed, the developer should have control over image height, width, and cell padding in the table visuals.
RE: Allow for rectangular imageUrl sizes in matrix and table visuals
Agree that the ability to scale the SVG to the width of the cell would be a major improvement to this functionality. Square cells are OK for short periods but any data dense sparkline tends to get crowded quickly, e.g. COVID time series data per location.
RE: Allow for rectangular imageUrl sizes in matrix and table visuals
Has anyone figured a solution to the square dimensions yet? This would really be appreciated if imageURL would allow for rectangular/wider images.
RE: Allow for rectangular imageUrl sizes in matrix and table visuals
Thank you, Darren. Having the ability to render SVG sprites, icons, databars and sparklines in a table or matrix cell is awesome but as Darren mentions; there are significant limitations in its implementation. Allowing the graphic scale to the cell dimensions would improve this capability significantly.