TIBCO Spotfire:A Comprehensive Primer(Second Edition)
上QQ阅读APP看书,第一时间看更新

Proportionality with bar charts and pie charts

It's all very well looking at the absolute numbers of female and male survivors, but this doesn't tell us the relative proportion of female and male passengers that survived.

Let's compare the use of bar charts and pie charts:

  1. Open the data panel again by clicking the Data button on the left-hand side of the Spotfire window.
  2. If the recommendations panel isn't shown, click the double arrow (>>) to display it. Now let's select the sex column as the target and scroll to see the relationship between sex and survived (analyst client). Choose the bar chart and add it to the analysis:

If you are using the web clients, you'll need to select both sex and survived and click MORE LIKE THIS on the bar chart for survived and sex to get to the bar chart for sex and survived. Note that the order is important here, as it determines which column goes on each axis of the bar chart. We need the sex column to be on the x (categorical) axis.

  1. Now, apply some coloring to the resultant bar chart to indicate that surviving is good and not surviving is bad! You should end up with something that looks roughly like this:
  1. That visual tells us the exact numbers of males and females that survived. How about proportionality? Right-click the visual and select 100% Stacked Bars (or in web clients, right-click to get access to the visualization Properties dialog and change the setting there):
  1. Let's return to the data panel once more in order to add a pie chart by showing the data panel and finding a pie chart that shows the same. In analyst clients, click MORE LIKE THIS to get to other representations of the relationship between sex and survived. In web clients, make sure sex and survived are selected in the data panel:
  1. Color the pie chart using the same color scheme as the last bar chart—doing that ties the visualizations nicely and visually.
  1. Your analysis should now look something like this. I have moved my visualizations around a bit by dragging their title bars:
A quick note on pie charts. There's a long-standing joke in the analytics community that the world's most accurate pie chart is this one:
The truth of the matter is that pie charts are not a good way of representing many categories of information—the human brain cannot easily interpret the chart if many slices of the pie are shown. The brain cannot distinguish between the different amounts of the area of the circle. So, in general, I would discourage you from using pie charts, or at least to think very carefully before doing so!
  1. The bar chart tells us a lot more than the pie chart and is indicative of several dimensions of data. You can see the total number of passengers of each sex and the proportion of each that survived at a glance.
  2. Experiment with the settings of the bar chart by right-clicking on it and selecting the various options. For example:
    • Change the bars to horizontal, stacked bars (the default), 100% stacked bars (as we just did), or side-by-side bars
    • Change the Sort bars by value setting of the bar chart
Bar chart modes
There's no right or wrong way to represent the bars—each setting is useful in different circumstances.
Stacked bars are useful if you want to represent the absolute numbers and proportions, or have a large number of values on the categorical ( x) axis.
100% is useful if you want to represent the proportions in a similar fashion to (but better than) pie charts.
Side-by-side gives a clearer view of the absolute numbers in each category of data.