© 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_4

4. Using Symbols

Alison Box1  
(1)
Billingshurst, West Sussex, UK
 
It may not have escaped your notice that up to now we’ve always used a rectangle mark in the Glyph pane and only ever created a column style chart. In this chapter, things are about to change because we’re going to turn our attention to creating “point” type charts, such as line charts and scatter plots, and learn how to use a symbol in the design of a chart; see Figure 4-1.
Figure 4-1

Point style charts using a symbol in the Glyph pane

However, although we know how to drag a symbol into the Glyph pane, we still don’t know how to plot it successfully onto the chart to produce line and scatter charts. Let’s remind ourselves what happens by starting with our default column chart (Figure 4-2).
Figure 4-2

Our default column chart where we have added a numerical legend

In this chart, we added a numerical legend, but if we replace the rectangle shape with a circle symbol in the Glyph pane, the chart will change as shown in Figure 4-3. What is particularly peculiar about the chart is that the positions of the symbols bear no relation to the numerical legend on the left.
Figure 4-3

The symbols don’t get plotted with the presence of a legend

What’s going on here? To answer that question, you have to understand that in Charticulator there is a critical difference between using a numerical legend which we have here and using a numerical axis, which is what we need. They both look the same when added to a chart, but conceptionally they are completely different elements and will have a very different impact on the layout of the chart. To throw some light on the reason why this is, let’s compare the numerical legend to the numerical axis in Charticulator.

The Numerical Legend

In charts generated in Power BI or Excel, whether they are column style charts or point style charts, the value axis is used to define the magnitude of the numerical fields plotted on the chart. However, in Charticulator when we created our column chart, we used a legend for this purpose.

In Chapter 2, you learned that it was the binding of a numerical value, for example, our “Sales” field, to the Height attribute of the rectangle that was responsible for plotting the rectangles correctly in the chart. To do this, Charticulator created a scale in the Scales pane that defined the scale being used by the numerical field which would be from 0 to the maximum value in the field (in our “Sales” field, that is 755,892, rounded up to 800,000). It’s the scale that is used to map the values in the numerical field to the height of the rectangles, and, indeed, it’s not possible to edit the values along the legend. Adding a legend is purely arbitrary and plays no part in how the data is mapped; if you remove the legend from the chart, the column chart still looks fine.

When we replace the rectangle with a symbol, there is no attribute of the symbol to which we can bind numerical data that will plot the symbols correctly on the chart, and so they sit stubbornly in the middle of the chart. The legend on the left is completely redundant.

The Numerical Axis

However, if we remove the legend from the chart and create a numerical axis, this will now drive the layout of the data in the chart, and so the glyph will be plotted according to the values along the axis. You create a numerical y-axis by binding a numerical value to the Y Axis attribute of the plot segment, or you can drag the field onto the y-axis on the canvas. In our example, we’ve bound the “Sales” field; see Figure 4-4.
Figure 4-4

Symbols are plotted according to the field bound to the numerical axis

What seems odd at first is that the numerical axis impacts on the glyph irrespective of the shape and size of the glyph. When we use a symbol, all seems well, but when we use a two-dimensional shape such as a rectangle, all looks a little bizarre. To see what I mean by this, drag and drop a rectangle shape on top of the symbol in the Glyph pane. The symbol is now sitting behind the rectangle, so you must move “Shape1” in the Layers pane above “Symbol1.” Lastly, bind a categorical field such as the “Salespeople” field to the Fill attribute of the shape. You should end up with an odd looking chart as shown in Figure 4-5.
Figure 4-5

Adding a rectangle to the glyph. Note the order in the Layers pane

Charticulator is treating the symbol and shape the same; they are both being plotted according to the values on the numerical axis. Because the rectangle is tall and thin, Charticulator takes the midpoint of the rectangle and plots that. It then overlaps the shapes to enable the plotting of the categories on the x-axis. For example, for 2017, all six rectangles that represent the six salespeople are sitting on top of each other. If we reduced the height and width of the rectangle by putting a value in the “Height” and “Width” attributes, for example, 10, essentially creating a data point, the chart would no longer look strange. The rectangles are still sitting on top of the symbols (Figure 4-6).

Warning

Once the glyphs overlap because of the numerical axis, they don’t reset themselves if you remove the field bound to the numerical axis. The glyphs will still sit on top of each other, and you will need to reset the sub-layout; see Chapter 5.

If you now look at the glyph in the Glyph pane, you will notice that by reducing the size of the rectangle, this changes the height and width of the entire glyph comprising both the mark and the symbol which are now both constrained inside the guides.
Figure 4-6

Both symbols and marks are plotted correctly on the chart

Notice that binding a numerical field to the Y Axis attribute of the plot segment does not generate a scale in the Scales pane. It’s the numerical axis that is responsible for the layout of the glyphs in the chart, and therefore we need no scale to map data onto the glyph.

Note

We’ve been binding data to attributes of the plot segment. If you’re wondering what a plot segment is, we will be focusing on plot segments in the next chapter.

With regard to numerical legends vs. numerical axes, it would appear that at the moment it’s an “either/or” situation. You can either have a column or bar type chart that uses a legend or you can have a point style chart that uses a numerical axis. This is a frustration that we will need to resolve later, but for the moment, you can just understand that you must use symbols if you want to use a numerical axis.

Creating a Line Chart

Now you understand that to plot a symbol onto a chart, you must bind your numerical value to the X or Y Axis attribute of the plot segment. Let’s pick up where we left with the chart in Figure 4-4 where we have a symbol in the Glyph pane. It’s currently plotting the symbols correctly, but the chart still looks confusing. The symbols represent each salesperson, but because the symbols overlap, it’s difficult to see which symbol is which. We need to join each salesperson’s symbol with a line. In other words, we need to transform the visual into a line chart. To do this, click the Link button on the toolbar and select the field represented by the symbols, for example, “Salespeople.” You can then use the attributes of “Link1” to format the line, perhaps increase the Width attribute to make the line thicker, and select Bezier from the Type attribute; see Figure 4-7.
Figure 4-7

To create a line chart, use the Link option on the toolbar

The slightly wavy effect on the Bezier line chart is a refreshing alternative to the rather prosaic line chart in Power BI.

Create a Scatter or Bubble Chart

To create a scatter or bubble chart, you need three numerical fields. I’ve added “NoOfSales” and “Qty” to the Fields pane.

You can now remove the categorical field from the x-axis and replace it with your second numerical field. To turn the scatter chart into a bubble chart, bind your third numerical field to the Size attribute of the symbol; see Figure 4-8.
Figure 4-8

A bubble chart requires two numerical axes

It’s a shame you don’t yet know how to insert x- and y-axis titles to show the fields being used on the axes, but all good time. You will learn to do this in Chapter 10. But for the moment, you can just be glad that you now understand why the behavior of Charticulator’s numerical axes is totally different from the behavior of the numerical legend. When I was first learning how to use Charticulator, I found this all very bewildering, and it took me some time to get to grips with this fundamental difference. You can consider this is a great leap forward in your knowledge of Charticulator.

For now, let’s leave line, scatter, and bubble charts and turn our attention to something we’ve been frequently alluding, and that is the plot segment. This is the subject of the next chapter, and through reading it, you’ll at long last learn how to create bar style charts where the bars sit horizontally rather than vertically, as in the case of the column chart. Who’d have thought that you’d have to work through four chapters on Charticulator until you find out how to build the commonplace bar chart, but when using Charticulator, as you are beginning to realize, very little is plain sailing.

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

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