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
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).
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.
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.
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
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.
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.