© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
A. BoxIntroducing Charticulator for Power BIhttps://doi.org/10.1007/978-1-4842-8076-8_13

13. Polar Scaffolds

Alison Box1  
(1)
Billingshurst, West Sussex, UK
 

In the last chapter, you learned how to use horizontal and vertical line scaffolds to lay out the glyphs in your chart as an alternative to sub-layouts. We also concluded that their use was limited to a few specific chart designs. However, there is another type of scaffold that does provide us with a wealth of design options. If you want to design circular types of chart such as pies, donuts, or radar charts, you will need to apply the polar scaffold, and, unlike horizontal and vertical line scaffolds, with this scaffold you’re supplied with a comprehensive choice of sub-layouts to work with. In this chapter, you will learn how to use the polar scaffold to generate not only conventional circular charts, such as the pie chart, but also more unusual and interesting ones too. We will also take a look at the custom curve scaffold which includes a tool for generating spiral and wavy style charts.

It might also be worth iterating at this point that the general consensus among data analysts is that pie charts and the like are not always the best choice of visualization. This is primarily because they can be difficult to decode when cluttered with many categorical fields. However, the purpose of this book is not to tackle the issue of which visuals are better than others but to teach you to use the tools and let you decide. We also know that by using charts generated by Charticulator, we can move away from the standard Power BI pie or donut charts with their cumbersome data labels and limited formatting options and instead design visuals that are able to engage with the consumers of our reports.

Just to whet your appetite with what can be achieved using the polar and custom curve scaffolds, consider the charts in Figure 13-1.
Figure 13-1

Charts created with the polar or the custom curve scaffold

If you think that these types of visualization have a place in the design of your reports, then read on and you’ll learn how to build them.

Applying a Polar Scaffold

Before applying the polar scaffold, start afresh and create a regular column chart similar to the one in Figure 13-2.
Figure 13-2

To apply a polar scaffold, start with a chart similar to this

This chart uses two categorical fields, one numerical field, and a rectangle mark in the Glyph pane. We’ve then bound the categorical “Salespeople” field to the Fill attribute.

To apply the polar scaffold, click the Scaffolds button on the toolbar and select Polar from the dropdown. Then drag the polar scaffold onto the plot segment as in Figure 13-3.
Figure 13-3

Apply a polar scaffold to the chart

The chart has now changed from a cartesian chart that uses x- and y-axes to a circular “donut” style of chart. Note in Figure 13-3 that there is a sector for both the category and subcategory, in other words a sector for every year for every salesperson, 30 sectors in all.

Tip

To convert the polar plot segment back to a 2D region plot segment, apply a horizontal line scaffold.

Already this donut chart is significantly different from a Power BI donut or pie chart where colored sectors can only define a single category. Also notice that applying a polar scaffold creates a polar plot segment. This can be identified in the Layers pane because of its different icon.

Reshaping the Polar Chart

Charticulator presents you with a donut-shaped chart when you first apply the polar scaffold. However, you can now easily change the donut shape into a pie shape by dragging inward on the inner radius of the chart. If you want to increase the circumference, drag outward on the circumference, and you can also drag between the glyphs to increase the spacing between them; see Figure 13-4.
Figure 13-4

Reshaping the polar chart

If you want to fine-tune these adjustments, you can also use the attributes of the polar plot segment where you can resize the plot segment and change the gap between categories and the spacing between glyphs.

To create an arc layout, where the plot segment starts and ends at specific angles, you can drag on the handles at the top of the chart in a circular direction, for instance, creating an angle of between 270o and 450o; see Figure 13-5.
Figure 13-5

Creating an arc layout

To move the arc shape to the bottom of the canvas, turn on the Automatic Alignment attribute under “Origin” in the plot segment Attributes pane. You can then move the bottom guide of the canvas upward to reposition the chart in the middle of the canvas. Another approach to moving the arc into the middle of the canvas is to drag the bottom guide of the canvas below the canvas.

Creating a Pie Chart

In Figure 13-6, we have styled a very simple pie chart using Charticulator. You will notice the chart only comprises one category, the “Salespeople” field. This is because a conventional pie chart is typically used to show the percentage breakdown of a total value across a single category and works best with fewer sectors. To create this chart, all that is required is to bind a numerical field to the Width attribute of the rectangle shape and close the gap in the plot segment attributes.
Figure 13-6

A Charticulator pie chart

The downside of using Charticulator to build standard pie charts is that displaying “detail labels” (e.g., the values or percentages as a callout) is problematic on two accounts.

Firstly, binding the “Salespeople” field to the angular axis (see the section on “Binding Fields to Polar Axes” below) would size the glyphs so they are equally spaced around the axis according to the value of the field bound to the Width attribute; see Figure 13-7.
Figure 13-7

Binding the category to the angular axis spaces the glyphs equally according to their value

Secondly, if you were to use a text mark anchored to the rectangle glyph to show the labels, the text mark will retain its alignment irrespective of the angle at which the glyph sits within the chart. The upshot of this is that the text marks may sometimes sit upside down. This wouldn’t happen to the detail labels on a Power BI pie chart. However, to remedy this problem, you could use a polar guide.

Using a Polar Guide

The polar guide allows you to anchor chart elements to positions either inside or outside the circular chart. Select the polar guide from the Guides dropdown on the toolbar and draw the guide onto the canvas, anchoring it to the top, bottom, and side guides of the canvas. To use the guide, anchor your text marks to the anchor points of the guide at the center of the circle. You can then drag your text marks and position them around the outside of the circle; see Figure 13-8.
Figure 13-8

Using the polar guide to anchor labels around the outside of the chart

Unfortunately, these text marks won’t respond to the data changing. We might conclude therefore that if we want to use a simple pie chart, we’d probably be better off building it in Power BI.

What we must do now, therefore, is to see how we can generate circular style charts that are not so easily constructed in Power BI, if at all. If we start to explore the attributes of the polar plot segment and bind fields to these attributes, we will learn how easy it is to morph the pie chart into a host of other designs. The starting point for this is to understand how the axes of the polar plot segment are used to change the design of the chart and control the layout.

Binding Fields to Polar Axes

A polar plot segment has two axes: angular and radial. You can bind categorical or numerical fields to either the angular or radial axis by dragging directly onto the plot segment or by using the Attributes pane.

Binding numerical fields to either axis doesn’t typically generate meaningful charts, so in this chapter we concentrate on using just categorical data on the angular and radial axes. If you want to plot numerical data onto the axes of a polar plot segment, it’s easier to use a data axis (see Chapter 14) as you have more control over how the data will be represented. However, there is an exception to this and one compelling reason to use a numerical radial axis, and that is in the construction of the radar chart, and we look at this specific example later in this chapter.

Working with the polar plot segment’s angular axis will be more intuitive for you as it’s the only axis that is used in Power BI pie or donut charts. The field you use for Charticulator’s angular axis is synonymous with the field you would put in the Legend bucket when constructing the Power BI pie chart. Binding a categorical field to the angular axis will group the glyphs in sectors around the center point, with the labels sitting around the outside of the chart.

The radial axis may be a little more challenging to get to grips with at first as there is no equivalent in a Power BI chart. With a categorical field bound to a radial axis, each axis category now comprises a concentric circle and is labeled accordingly; see Figure 13-9.
Figure 13-9

The angular and radial axes of the polar plot segment

Once you have plotted the axis you require, you can then further change the layout of the polar plot segment by using one of the sub-layouts. Let’s see how these sub-layouts can enable you to design the charts of your choice.

Using Polar Plot Segment Sub-layouts

You will find the option to change the sub-layout at the bottom of the Attributes pane of the plot segment, but it’s easier to use the options on the dropdown of the plot segment toolbar as shown in Figure 13-10.
Figure 13-10

The sub-layouts of a polar plot segment

Although there are six sub-layouts to choose from, we’re going to focus on just the stack angular and stack radial sub-layouts as these are the ones used in most circular chart designs. In all the examples of sub-layouts that follow, we will be using the fields as shown in Figure 13-11.
Figure 13-11

The fields used for all the examples in the section on sub-layouts

We now have four combinations of axis and sub-layout to work through, each one generating a different style of chart:
  1. 1.

    Stack angular with angular axis

     
  2. 2.

    Stack radial with angular axis

     
  3. 3.

    Stack angular with radial axis

     
  4. 4.

    Stack radial with radial axis

     
These four combinations are set out in Figure 13-12 where the “Year” field is plotted onto the axis and “Salespeople” field provides the subcategory.
Figure 13-12

Combinations of sub-layouts with angular and radial axes

As with cartesian charts, the fields you bind to the axes take precedence. With an angular axis, the years are represented by sectors, but with the radial axis, the years are represented in concentric circles. The sub-layouts then stack the glyphs representing the subcategory (in our examples, the salespeople) side by side (stack angular) or one on top of the other (stack radial).

These various permutations can be a little bewildering when you first meet them, so let’s now take a more detailed look at how we can fashion different chart types using each of these four combinations of axes and sub-layouts. We will look specifically at building the following chart types:
  • Rose (angular axis and stack angular sub-layout)

  • Peacock (angular axis and stack angular sub-layout)

  • Nightingale (angular axis and stack radial sub-layout)

  • Radial chart #1 (radial axis and stack angular sub-layout)

  • Radial chart #2 (radial axis and stack radial sub-layout)

Once you have learned how you can build these charts, we will then leave it to you to self-explore the myriad of other options and permutations when working with a polar scaffold.

Rose Chart (Angular Axis and Stack Angular)

In Figure 13-13, you can see how we can transform the default pie chart into a rose type chart. To do this, with the default stack angular sub-layout applied and the “Year” field on the angular axis, the “Sales” field has then been bound to the Height attribute of the rectangle shape.
Figure 13-13

Using an angular axis and stack angular sub-layout with a numerical field bound to the Height attribute of the rectangle

The angular axis arranges glyphs around the axis in the same way as an x- or y-axis and that is to arrange them equally around the axis according to the value bound to the Width attribute. The result of this is that a gap will be produced for smaller values (see Figure 13-7).

Peacock Chart (Angular Axis and Stack Angular)

In Figure 13-14, we have set out the steps to create a peacock chart. Starting with the default chart, you will need to drag on the handles at the top of the plot segment to create an arc (i.e., an angle of 270o to 450o), and you can then bind a numerical field to the Height attribute of the rectangle. If you then change the shape of the mark to an ellipse, this will produce the peacock shape. In our example, the final step was to use the “Sales” numerical field in the Fill attribute, giving the chart a spectral gradient fill.
Figure 13-14

A peacock chart uses an angular axis and a stack angular sub-layout

You will notice that we have also filtered the “Year” field to show only three years. This type of visual, like pie charts, generally works better when you have fewer categories.

Remember to turn on the Automatic Alignment attribute to move the peacock chart to the bottom of the canvas. You can then adjust the bottom guide of the plot segment to move the chart into the middle.

Nightingale Chart (Angular Axis and Stack Radial)

To create a nightingale chart, you will need to use the default angular axis but change the sub-layout to radial. It’s not until you bind a numerical field to the Height attribute of the rectangle that the chart is transformed into the nightingale chart, seen in Figure 13-15. Reducing the subcategories and closing the gap on the angular axis can result in a less cluttered chart.
Figure 13-15

Transforming the default chart into a nightingale chart using an angular axis with a stack radial sub-layout

Using the stack radial sub-layout, the glyphs are grouped by year and stacked in concentric layers to show values for the salespeople. The real benefit of this chart is that not only can we analyze our salespeople’s performance and see that “Charron” is doing nicely, but we can also easily see that the years 2020 and 2021 were the better years. It’s the binding of a numerical value to the Height attribute of the rectangle that gives this visual its strength.

Radial Chart #1 (Radial Axis and Stack Angular)

To explore sub-layouts that are combined with a radial axis, let’s start by designing a radial style chart that uses a stack angular sub-layout. As soon as we then bind the “Year” field to the radial axis, the glyphs are rearranged accordingly where each year is now represented by a concentric circle and the glyphs are grouped by each salesperson in sectors. If we now apply some techniques that we’ve already learned, the chart can be redesigned into an arc shape radial chart; see Figure 13-16.
Figure 13-16

Binding a categorical field to the radial axis and using the stack angular sub-layout

In this chart, we bound a numerical field to the Width attribute of the rectangle to plot the data. However, the radial axis for the years by default sits vertically at the top of the chart. If you change the angle of the plot segment (i.e., an angle of 270o to 450o), this would move the axis so it sits horizontally.

You will get some more interesting layouts if you experiment with the plot segment’s horizontal and vertical alignment options or the gap and sorting options.

Radial Chart #2 (Radial Axis and Stack Radial)

The last combination of axes and sub-layouts that we will explore is when a categorical field is bound to the radial axis and then a radial sub-layout is applied. This again will generate a radial style chart but with a completely different look and feel. In Figure 13-17, starting with the default chart with a stack angular sub-layout, we can apply the “Year” field to the radial axis and change the sub-layout to stack radial. The glyphs representing each salesperson now sit in concentric circles. To plot data onto the chart, we need to bind the “Sales” field to the Width attribute of the rectangle, but it’s difficult to see what’s what in the chart at this stage. Filtering the number of salespeople showing, increasing the gap on the radial axis, and changing the shape of the glyph to an ellipse renders the chart a little more promising.
Figure 13-17

Redesigning the default chart to use a radial axis with a stack radial sub-layout

Having worked your way through these four permutations of axis and sub-layout, you must understand that you are still at the very tip of the iceberg with regard to the number of interesting and unusual charts that you could possibly design by applying the polar scaffold. Why don’t you go on a voyage of self-discovery and see how many variations on the humble pie chart you can create by applying a polar scaffold and then changing different attributes of the plot segment and glyph? In Table 13-1, I’ve set out a few suggestions as to which attributes you might try modifying to see how many variations of a polar chart you can discover and invent.
Table 13-1

Attributes you can modify to generate interesting polar charts

Attribute to Modify

Example

• Alignment

We’ve only used the “Bottom” and “Left” alignments, but you could try to edit these and see what impact it has on your chart.

• Shape

Explore using triangles or ellipses. You could even experiment with symbols in the Glyph pane.

• Angle

As we have seen, creating arc-shaped charts by changing the angle can produce an interesting variation on a circular chart.

• Gridlines

You can show radial or angular gridlines using attributes of the relevant axis.

• Binding data

We’ve always bound numerical fields to the Height attribute for the angular axis and to the Width attribute for the radial axis, but there is no rule regarding this.

Height to Area

The Height to Area attribute is an attribute of the plot segment, and we need to take a more detailed look at it. Toggling the attribute on or off will affect the way the numerical data is plotted in the chart.

When you bind a numerical field to the Height attribute of a rectangle glyph, when plotted on a polar plot segment, the heights of the glyphs will be proportional, but the areas will be skewed for smaller values as the radius decreases. The outcome is that smaller values look disproportionally smaller relative to the area. The reason for this is that the “Height to Area” attribute of the polar plot segment is checked off by default.

If you want the area of the glyph to reflect the value bound to the Height attribute rather than its height, check on the Height to Area attribute. In Figure 13-18, we have an example of how this works. You can see that the green sector has a value of 4000 and so by default will be twice the height of the red sector whose value is 2000. When Height to Area is turned on however, the green sector has an area that is twice the area of the red sector.
Figure 13-18

The Height to Area attribute

Use the Height to Area attribute by checking it on to ensure that the numerical value bound to the Height attribute drives the area of each sector, as opposed to the height.

Numerical Radial Axis – The Radar Chart

So far in this chapter, we have only used categorical fields on the angular or radial axis of the polar plot segment, and this is because most polar charts use categorical axes. However, there is a good reason to use a numerical field on the radial axis of the polar plot segment and that is to generate a radar chart, an example of which you can see in Figure 13-19.
Figure 13-19

The radar chart uses a numerical radial axis

This radar chart analyzes three students’ examination marks across five subjects, and we can easily infer from this visual that Graham is the most successful student overall, although in Geography, all three students are pretty much on a par with each other. The chart uses the data that is shown in Figure 13-20.
Figure 13-20

The data plotted onto the radar chart

Let’s now explore how this chart was built. We started with a new chart and then applied the polar scaffold to the plot segment. We know that when we use a numerical axis on a cartesian chart, the default sub-layout is Overlap, and the norm is to use a symbol in the Glyph pane. This is no less true for numerical axes in polar charts. With a symbol in the Glyph pane, the “Student” field was then bound to the Fill attribute of the symbol and the “Subject” field was bound to the angular axis. The “Mark” numerical field was bound to the radial axis, generating a numerical radial axis that has all the same attributes as a numerical x- or y-axis. The Range attribute of the plot segment was set from 0 to 100.

To create the “radar” aspect of the chart, we used the Gridline attribute of the radial axis to apply the radial gridlines, and then using the Link button on the toolbar, inserted a Line link, linking the “Student” field. The last action was to ensure that the Close Link attribute was checked on; see Figure 13-21.
Figure 13-21

Close the link line to create the radar chart

You may also find that you need to change the link line type to “line” rather than “Bezier.”

The Custom Curve Scaffold

It’s now time to look at the last of Charticulator’s scaffold types and that’s the custom curve scaffold. Charticulator allows you to generate charts where you can draw the shape you require on the canvas such as curvy, wavy, circular, or square. In Figure 13-22, you can see we have drawn a curvy chart. However, just as with the use of the pie chart, we need to think carefully whether such charts can provide any valuable information. It might be a case of just because you can doesn’t mean you should! But I don’t want to be a spoilsport, and if Charticulator provides us with the tools to design such charts, we will include them in this chapter.
Figure 13-22

A visual created with the custom curve scaffold

To use the custom curve scaffold, begin afresh with a new chart that uses two fields, one categorical and one numerical, and then put a rectangle mark into the Glyph pane. You can then bind your numerical field to the “Width” attribute of the rectangle and categorical field to the “Fill” attribute. In the visual shown in Figure 13-22, we used the “Regions” categorical field and the “Sales” numerical field and also sorted the glyphs ascending by numerical value, but the sorting isn’t essential.

Applying the Custom Curve

You are now ready to apply the custom curve scaffold. To do this, from the Scaffolds button on the toolbar, drag the custom curve scaffold into the plot segment; see Figure 13-23.
Figure 13-23

Applying a custom curve scaffold

A default curve is created for you, but you can then use the pencil button top right of the plot segment to draw any shape you want; see Figure 13-24.
Figure 13-24

Drawing your own custom curve

The custom curve scaffold creates a custom curve plot segment that you will see in the Layers pane. You can bind data to the tangent and normal axis by using the Attributes pane.

Creating a Spiral

As part of the custom curve scaffold, you can also produce spiral type charts. To do this, start with a very simple chart that comprises a rectangle mark that has a numerical field such as “Sales” bound to the Width attribute and a categorical field such as “Regions” bound to the Fill. Then close the gap to zero in the plot segment attributes to pull the shapes together. It works best if you restrain the Height of the rectangle to a measurement, such as 30, but experiment here to see what works for you.

Now apply a custom curve scaffold, and a wavy chart is generated by default. Click the spiral button top right of the chart, and a spiral is now made; see Figure 13-25.
Figure 13-25

Creating a spiral chart

By default, the spiral will start at the 180o point (i.e., at the bottom of the spiral), but you can change this in the Start Angle attribute. For instance, start the spiral at the top of the chart with the 360o angle (Figure 13-26).
Figure 13-26

Specifying the start angle of the spiral

You can also specify the Windings which determines the tightness of the spiral. The bigger the number, the tighter the spiral (Figure 13-27).
Figure 13-27

Specifying the Windings of the spiral

I think you’ll agree that by using Charticulator’s polar and custom curve scaffolds and by combining angular and radial axes with the sub-layout options, you’ve been able to design some engaging, interesting, and unusual visuals. You now also know how to design a radar chart. It’s true that we need to be cautious in our choice of visual, and you may feel that some polar and custom curve charts are not always the best choice to do the job of reporting on your data. However, now that you know how to create pie, nightingale, and radial charts using Charticulator, at least you can make that choice for yourself.

In the next chapter, we turn our attention away from scaffolds and instead focus on the numerical data that we want to analyze in our visuals. It may not have escaped your notice that up to now, our data has mostly comprised a single numerical value, that is, the “Sales” value. This has been because designing charts that use multiple metrics often requires a completely different approach from plotting just a single numerical value against multiple categories. So let’s move forward and learn how to design visuals that can compare and contrast the metrics that matter to us.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.218.254.122