This post is a continuation of my exploration of the latest updates on the PureViz custom visual for Power BI.
In my previous post, I looked at colour fill and show/hide options, in this post I will look at shape fill and position.
I began with a collection of shapes in PowerPoint – lines, circles, text and icons. It might not make for the best infographic, but it was good enough for a play.
![](https://kerrykolosko.com/wp-content/uploads/2022/04/1.png)
Once finalised, I selected all shapes and saved as SVG. Upon import into the PureViz visual I could see the dimensions for various shapes, but could not see the dimensions for the lines. As I had intended to move markers along these lines, it was difficult to determine how far to move these markers horizontally.
![](https://kerrykolosko.com/wp-content/uploads/2022/04/image-14-1024x607.png)
So I looked at the SVG in visual Studio Code and saw that the lines were represented as path elements.
![](https://kerrykolosko.com/wp-content/uploads/2022/04/image-15-1024x625.png)
![](https://kerrykolosko.com/wp-content/uploads/2022/04/image-16-1024x786.png)
Rather than calculate the length of the paths, I re-opened my PowerPoint and changed the lines to rectangle shapes, and re-imported into PureViz.
Aha! There we go…
The element was now recognised as a rectangle with its respective dimensions.
![](https://kerrykolosko.com/wp-content/uploads/2022/04/2.png)
A quick look in Visual Studio confirmed the new shapes were represented by rectangle elements with width and height dimensions of 1299×11.
![](https://kerrykolosko.com/wp-content/uploads/2022/04/image-17-1024x74.png)
Knowing the width of the rectangles then allowed me to calculate position of the markers. I started by selecting the first marker shape and assigning it to a category (Gift=Sweets) under the Move X function.
![](https://kerrykolosko.com/wp-content/uploads/2022/04/4.png)
![](https://kerrykolosko.com/wp-content/uploads/2022/04/3.png)
Then modified the formula to find its proportionate position along the line.
{math|1299*[Amount::sum?Gift=Sweets]|}
![](https://kerrykolosko.com/wp-content/uploads/2022/04/7.png)
I applied the same logic to the icons, updated the text labels to be dynamic, and took a look at the result.
![](https://kerrykolosko.com/wp-content/uploads/2022/04/image-23.png)
It was a bit bland. So I thought I’d add a little more colour.
I changed the markers from triangles to circles and modified the line (rectangle) shapes to have a percentage fill. I chose red for the filled colour and increased transparency for the empty colour.
![](https://kerrykolosko.com/wp-content/uploads/2022/04/8.png)
![](https://kerrykolosko.com/wp-content/uploads/2022/04/6.png)
Interesting…
![](https://kerrykolosko.com/wp-content/uploads/2022/04/circfin.png)
I decided to add a little more context to the graphic through tooltips. I selected the first icon group, then the show tooltip option.
![](https://kerrykolosko.com/wp-content/uploads/2022/04/image-18-1024x741.png)
I used Advanced Dynamic Formula to calculate the filtered amount and append a text description.
{math|[Amount::sum?Gift=Sweets]*100|,}{text|% of adults surveyed gifted chocolates|}
![](https://kerrykolosko.com/wp-content/uploads/2022/04/image-19-1024x737.png)
And done.
![](https://kerrykolosko.com/wp-content/uploads/2022/04/fin-1024x503.png)
Hello Kerry, great report, you are using custom viz like a boss !!!
Can we get the .pbix file for this example ? Please
Thanks,
Kind Regards,
Antoine MICK