
上QQ阅读APP看书,第一时间看更新
Drilling in to the data – details visualizations
The visualizations we've explored so far allows us to understand what is happening—in our case, we've understood the proportions of male and female survivors. That's great, but what about drilling into the details of the data? Drilling in can help us explore why something is happening in the main dataset.
Spotfire makes it really easy to drill in to the data:
- Right-click on any of the visualizations you created earlier and highlight Create Details Visualization. A second menu will pop up:
- For the purposes of this exercise, let's use a bar chart (again!), so click Bar chart....
Bar charts are some of the most often used visualizations in Spotfire as they can represent data in so many different ways. I find them to be very useful! - Spotfire will create an auto-configured visualization that in itself isn't useful. It's also empty:
- Never fear—we can fix both these issues with a few clicks! Note that a new item has been added to the legend Data limiting: Marking. This means that, by default, no data will be shown on the visualization unless some data is marked in another visualization. In order to show some data, hover the mouse over some data in another visualization, click and drag it to create a rectangle, and select some data:
- The details bar chart will now update to show the selected data. It's still not terribly useful as it's currently just showing the same as the original visualization chart. To configure the x-axis (the bottom one), hover over the visualization, then click the down arrow on the x-axis selector (it appears when you hover over the visualization):
- From the resultant dropdown, choose age. That's more like it!

- However, it's not yet quite as useful as it should be—notice that the overall shape of the graph is indicative of a distribution of the data (move on to see more), but the tall bars are often interspersed with very short bars between them. This is an example of a real-world data issue that prevents us from visualizing the trend in the data properly. The cause is that some people have been recorded with fractional ages. Babies under one year old have ages recorded as a fraction of a year; there are also some adults recorded as being x.5 years old. Why? I don't know, but let's fix it!
- If you're using an analyst client, right-click on the x-axis selector (showing age) and choose Auto-bin Column:
- In a web-based client, follow these steps:
- Right-click on the x-axis column selector and choose Custom Expression....
- Enter the following custom expression:
AutoBinNumeric([age],80)
- You'll notice that the visualization will change to look more blocky. What's happening is that Spotfire is binning the data, or grouping close values together to reduce the number of categories on the x-axis. In analyst clients, you can slide the little slider up and down on the axis slider to change the number of bins (this affects the granularity of the x-axis), or you can edit the custom expression, just like we did on the web clients. I surmise that 80 bins is a good number because that gives one bin per year of age in our data:

- I have also rearranged the visualizations on the page slightly in order to give more room to this bar chart—you can do that by dragging the title bars of the visualizations and dragging the dividing lines between them.
- Experiment with marking (selecting) different parts of the rest of the visualizations on the page in order to drill in to different parts of the data. Try selecting all male passengers, all female passengers, all females that survived, and so on.
- As we described previously, the default behavior of a details visualization is for it to be empty if no data is marked elsewhere. That might not be what you want—you might want all data to be shown if nothing is selected. You can't change this behavior in the Spotfire web clients, but you can do it using Analyst. Right-click on the visualization and choose Properties, or click the cog wheel in the top right-hand corner of the visualization. The cog wheel isn't shown by default, so you'll need to hover over the corner of the visualization to make it visible.
- Select the Data property page and open the setting under If no items are marked in the master visualizations, show:

- Change the setting to All data.
- Now, if you go back to the analysis and unmark any marked data by clicking outside of the marked items, you'll see that all data will be shown on the details visualization.