CODE201911 Practices DataVisualizations
CODE201911 Practices DataVisualizations
many of us easily fixate ourselves on the potential capabili- • Choosing visuals to convey strategic points
ties for creating queries, developing custom programming • Positioning and the number of charts/visuals
code, or creating extensive calculations on the back-end be- • Instruction prompts
hind the scenes. However, the majority of business users use • Colors to point out key trends
these data visualization platforms to dynamically interact
with this top layer of application: the dashboard. To develop Users want you to do the analysis of the components before-
these user-friendly dashboards, we need to think more like hand, but they want to interact with the data themselves
designers instead of programmers. using the instructions you provide. If the pieces don’t fit
together, or if the instructions don’t make sense, building a
Helen Wall successful final product becomes much more difficult.
www.helendatadesign.com The Importance of Dashboard Design
Helen Wall is a power user of The best-designed and implemented dashboards appear The Starting Dashboard
Microsoft Power BI, Excel, and effortless; we like them more, but yet can’t quite explain I chose Tableau for this example because I think it enables
Tableau. The primary driver exactly why. Their likeability comes not by accident, but by a focus on making changes with best design practices in
behind working in these tools mindfully following design principles implemented with the mind, given that the tool focuses on the visuals themselves.
is finding the point where end viewer in mind. Good design isn’t an accidental result, It also works on Apple products at the time of publication
data analytics meets design but rather a strategic decision to choose to make the small for this article, and Microsoft Power BI, unfortunately, does
principles, thus making data design choices that have a huge impact on the end result. not. You can use different versions of Tableau, but for the
visualization platforms both an purposes of this article, I’ll use Tableau Public Desktop,
art and a science. She considers Nudging which is free to download. You can download the starting
herself both a lifelong teacher In order to maximize the likelihood that users make your file from Tableau Public Online to follow along with the
and learner. She is a LinkedIn dashboard part of their everyday processes, you need to changes I make in this article, and then save it by uploading
Learning instructor for Power design dashboards that guide users through not only key it to your own Tableau Public Online account.
BI courses that focus on all as- visuals and figures, but also how they collectively interact
pects of using the application, with each other. A dashboard can check all of the user’s I obtained the infant mortality data from the impressive
including data methods, dash- requirements, yet still not yield much value to the user be- data section of the Gapminder website developed by the
board design, and programming
cause there’s a dissonance between what the y tell you they late Hans Rosling. The data set contains the infant mortal-
in DAX and M formula language.
would like and how their actual behavior responds to the ity rates by country and by year from 1800 until 2015. Note
Her work background includes
an array of industries, and in
dashboard. How do you bridge this gap? Let’s put this dis- that there are incomplete data sets because some countries
numerous functional groups, cussion in the context of the nudging proposition. may not have data (or at least useable data) for all of these
including actuarial, financial years. I categorized each country into its own region of
reporting, forecasting, IT, Nudging is defined as tiny prompts that alter our behav- the world, as you can see in the region mapping key file in
and management consulting. ior—specifically social behavior. Richard Thaler extensively Figure 1.
She has a double bachelor’s examined nudge theory in his book Nudge. Examples of
degree from the University of nudging techniques include: The Gapminder site defines infant mortality as the number
Washington where she studied of deaths in the first two years of life for every 1000 live
math and economics, and also • Encouraging recycling, by placing a larger recycling births. Although you may think this project is taking a mor-
was a Division I varsity rower. bin in a more prominent location than a smaller gar- bid direction, you’ll see that the Tableau dashboard helps
On a note about brushing with bage bin in many cities and businesses. communicate a much more positive outcome. A decrease in
history, the real-life characters • Sending out electricity bills that compare usage to these rates means that the survival rates are increasing and
from the book The Boys in the that of neighboring housing units to encourage users improving global health outcomes.
Boat were also Husky rowers to limit their electricity usage.
that came before her. She • Charging even the nominal amount of a few cents for To walk through the steps of applying best visualization de-
also has a master’s degree in single-use plastic bags encourages people to bring sign practices, let’s begin with a less-than-optimal Tableau
financial management from their own reusable bags when shopping or not use one dashboard I created, as seen in Figure 1. I can make stra-
Durham University (in the at all. tegic design and formatting changes that transform it into
United Kingdom).
a more effective dashboard built with the end user in mind.
Much like Ikea furniture comes in a box with pre-cut pieces
and instructions for assembly, you want to present your You will need several components to try this out on your
dashboards to the user in a similar manner. Think of the in- own, including the Tableau Public dashboard links below
struction manual as the nudging component to the product. and the link for the two Excel files and the PNG image that
This translates to techniques in designing data visualiza- are available on the CODE Magazine page associated with
tions (which I’ll discuss later) such as: this article.:
• Starting Tableau dashboard: https://public.tableau. and they enjoy the process, you’re telling them that you
com/views/VisualizationBestPracticesstartingfile/ value their ability to analyze the data trends and take own-
Dashboard1?:embed=y&:display_count=yes&:origin=viz_ ership in this process. Psychologists define this as the “Ikea
share_link effect” (https://www.bbc.com/worklife/article/20190422-
• The Excel file from Gapminder data with the infant how-the-ikea-effect-subtly-influences-how-you-spend)
mortality rates where the customers (in this case dashboard viewers or
• The Excel file for country to region mapping users) feel they achieve the greatest value for their invest-
• The Gapminder logo ment. This is the Holy Grail for many businesses.
• Ending Tableau dashboard: https://public.tableau.com/
shared/8TZ3K2TWW?:display_count=yes&:origin=viz_ On the flip side, you need to do a lot of work on your end to
share_link get the users to feel this empowerment and ownership in the
process. Making the process easy for the user involves putting
You need to update the Tableau file to point to the Excel file yourself into their thought patterns to analyze the unknowns
on your own dashboard: and numbers before they even see them in the dashboard.
These areas for you to analyze beforehand for them include:
1. Download the Tableau Desktop Public application (free ver-
sion) or you can use Tableau Desktop if you already use that • The meaning and magnitude of data set numbers
2. Download both Excel files and the Gapminder logo to a • The relationship between data points and data fields
folder in your own desktop or documents folder. • Optimal ways to see the data in visuals and charts
3. Open up the Tableau link for the starting dashboard
with your own Tableau application How do you want to measure the infant mortality rate? Does
4. Go into the Data Source tab of the Tableau file, click on a higher rate indicate a better or worse metric? You need
each of the connections for the rates and region key, and to establish that you want to see lower infant mortality
set the folder connection to the path on your own desktop. numbers because this means that more babies are surviving
out of infancy, which also indicates improving public health
After you update the sources, the rest of the visualization will outcomes. You can’t assume that the reader already knows
update as well, and you can begin the transformation process. this, and you need to explicitly say what the numbers mean
in context of the bigger picture.
The “Ikea Effect”
Looking at Figure 1, can you tell at first glance what the Furthermore, you also need to indicate how you’re aggregat-
initial dashboard is analyzing? Inconspicuous legends and ing these infant mortality numbers. Each point in the data
axis labels serve as the only indications that you’re studying source represents the infant mortality for a given year and
infant mortality rates. The user shouldn’t have to guess at country. If you wanted to determine the global infant mortal-
what you’re trying to do. ity rate for 1990, for example, you need to analyze the data
points for all of the countries that year. It doesn’t make any
Building successful data visualizations involves striking a sense to sum them together because they represent rates and
balance between giving dynamic options to the viewer and not absolute values. It makes more sense to average all of
your own design and analysis process. When viewers feel like these data points to get this global mortality rate the years
they do most of the work by interacting with the dashboard and countries we want to see as an aggregated number.
If you buy furniture from Ikea, you assemble it yourself Effective chart options include:
from pre-cut pieces that come in a box that designers
planned out and tested ahead of time. Similarly, in dash- • Bar charts
boards, you want to analyze the data and plan out the • Line charts
dashboards before passing it off to the user to interact • Scatter plots
with in a pre-packaged box in the form of a dashboard. If • Box and whisker plots
you don’t include a necessary piece or if the sizing doesn’t • KPI metrics
work, neither you nor the viewer get the desired finished • Heat maps
product or result. Much like Ikea furniture comes in a box • Highlight tables
with pre-cut pieces and instructions for assembly, you
want to present your dashboards to the user in a similar You can see the infant mortality rates by region represented
manner. Users want you to do the analysis of the com- as a pie chart in the upper left-hand corner of Figure 1. This
ponents beforehand, but they want to interact with the chart presents two big issues when you view it:
data themselves using the instructions you provide. If the
pieces don’t fit together or if the instructions don’t make • You can’t easily distinguish between the slices of the
sense, the likelihood that they will embrace this dash- pie because you have to guess the angles rather than
board as their own goes down substantially. actually measuring the numbers.
• The chart represents the infant mortality rate as a sum
of the rates, which can mislead the audience because
Good Design Isn’t an Accident regions with more data points and complete data will
How do you approach designing your best possible version have a bigger slice, even if they have lower infant
of the dashboard? What do you consider for the job at hand? mortality rates.
You want to analyze the data initially to create components
for the dashboard that fit together with each other. Much The bar chart (Figure 2) does a much more effective job
like an Ikea furniture pack, you design and test the pieces of showing the average infant mortality rate by region
to make sure they fit together beforehand. (changed from the sum aggregation in the pie chart), and
you can easily rank and compare these rates between re-
When you like the way something looks, you can’t always gions directly within the chart.
quite explain why. The “why” comes through your decision
to strategically choose to apply design principles to it. De- To change a pie chart into a horizontal bar chart:
signing an effective dashboard that users embrace interact-
ing with is not an accident, but rather a well-planned ap- 1. Move the “Region” dimension to rows.
proach that keeps the user in mind. 2. Change the chart from a pie chart to a horizontal bar
chart in the Show Me options menu.
Choose the Right Visuals for the Job at Hand 3. Change the aggregation of the infant mortality rate
The first step in this process is selecting visuals that repre- from Sum to Average.
sent the data correctly, and also effectively communicate
the results and trends in the data. There’s no one chart that You also lose the time dimension this way because you’re mea-
works for all data and no one data set that works for all suring the average infant mortality rate for all years for coun-
charts. I encourage you to experiment with charts within tries within each region in Figure 2 rather than in a certain year.
the data visualization application to compare how they
represent the data and what visual works best for your in- Because you want to measure a time value, you can use a
tended result. line graph or a bar graph. What if you took this infant mor-
You can’t stack up the region bars in Figure 3 because you To change from a bubble chart (Figure 1) into a shaded
want to average rather than sum the rates. Showing the filled chart (Figure 5):
average infant mortality rates by region as a line chart miti-
gates the size and readability issues that you encounter for 1. Select the Show Me option menu and pick the maps
this scenario with bar charts. chart icon
2. Change the aggregation from Sum to Average for the
The line chart in Figure 4 allows you to easily rank the regions Color Marks card option.
for each year, and you can see the infant mortality rate trends
by region because each point in the graph joins to the point for Now I’m going to tackle the two charts you saw in Figure
the next year and the previous year and so on. More importantly, 1 that show the infant mortality rates by country as a bar
you can also easily see that the rates trend downward across all chart and the average infant mortality rate by year as a data
regions, which means that global health outlooks are improving, table by combining them into a single visual rather than
even if you continue to see disparity among the regions. two, which makes it easier to easier. You can see some key
Selecting an aggregation
option allows you to analyze
trends in the data set.
visual shows both the rate as a text value and a color, and you 3. In the values area (or the Text Marks card), you have an
can see that the color effectively illustrates an improved in- average of infant mortality rate. It doesn’t matter if you
fant survival rate in recent years for all countries in this view. use sum or average here because for each row and col-
umn coordinate in the data table, you only have a single
Now change it into a single table (Figure 6) with rows and corresponding value, but it makes the most sense to just
columns combined with the data in the chart, and then into select the average aggregation to line up with the other
a highlight table (Figure 7): visuals. If you inspected the Excel file, you may remem-
ber this is what the data table looks like.
1. Move the Year dimension from rows to columns. 4. To convert to a highlight table, select the highlight
2. Add the Country dimension to the rows, so that you table icon from the Show Me menu. If it switches the
now have a data table with years in the column labels rows and columns when you convert the visual type,
and countries in the row labels. just move them back into the correct positions.
• If a country has gaps in a time range, averaging out To sort the country order:
the rates within a ten-year segment allows you to
smooth out those inconsistencies. 1. Go to the last column where the 2010 through 2015
• It also makes it possible to see the entire time range years aggregate and click on the header. You’ll see the
in a single view, as you can see in Figure 8. I chose to sorting icon that looks like a little bar chart appear.
use ten years because it allows me to have enough ag- 2. Click on the little horizontal bar chart icon once, where
gregated rates within a reasonable time range without you see the highest rate for Angola, then click on it
missing too many data points. again to see it listed by lowest infant mortality rate
To create bins for the years and update the highlight table Make the Labels Easy to Read
(Figure 8): If you cut off the label names in a visual, do you expect the
viewer to fill in the missing letters and guess the name?
1. Add a newly calculated field for the year and enter the In Figure 11, you can’t see the entire country name for
formula Year (YEAR) = YEAR([Year]) (see Figure 9). the healthiest country. Even if you know to add an “in” to
complete “Liechtenstein,” that may not be an option if you You also add the year filter to the filled map chart as you
have more than two hundred or so options (country names) can see in Figure 15, with the option to select multiple or
to guess the finished name outcome, which Figure 12 will all years within the view rather than showing the average
spare you the pain of having to do. infant mortality rate across all available years. This allows
the viewer to create a custom view of the map based on their
To expand the size of the country column: selected year, and dynamically update the colors on the map
that represent the infant mortality rates averaged across
1. Hover over the border between the country name and the selected year or years.
the values section until a double arrow appears.
2. Drag the arrow until the column width expands to com- To add the Years filter:
fortably fit the country names in the immediate view,
as you see in Figure 12. 1. Go into the map worksheet and put a filter on the filters
shelf. Figure 11: A table sorting by
You can also wrap the text fields, but I wouldn’t recommend 2. Select all the years, and then select to show the filter. lowest mortality rate in 2010
that approach for the highlight table because it increases 3. Setting this up as a drop-down list has many benefits, to 2015 to highest rate
the height of these wrapped fields and throws off the sizing including taking up less space. I’d also recommend the
for the entire visual, and can make it more difficult to read. drop-down list because you can see that the single list
takes up a great deal of space and doesn’t do much
Use Filters Within Visuals for you.
The line chart you created in Figure 4 looks like colored
spaghetti lines over a two-hundred-year time frame, which The drop-down list is shown in Figure 16.
can make it slightly difficult to analyze. Because incomplete
data drives much of this fluctuation, if you want to use this I’ll revisit the filter options in much more detail later when
line chart visual as an effective analysis tool, it seems sen- you set up the dashboard.
sible to filter down the chart to only show the trends from
1950 and onward, as you see in Figure 13. Applying Color Effectively
In Tableau and many other data visualization platforms,
To adjust the line chart: the application automatically assigns a color palette to the
chart. However, using the default option may not present
1. Go to Sheet 1 and add Years to the Filters Marks card. the best color scheme. To leverage color effectively, you
2. Select Years and the condition as greater than or equal want to limit the color scheme you use (as contradictory as
to the 1st of January in 1950, as you see in Figure 14. that sounds) because strategically applying just a few colors
3. Filter out the null region from the table (remember not only makes the visuals easier to read, but also allows
these are countries that you don’t have a matching users to focus on key trends and numbers.
region for because they are so small) by dragging the
Region dimension to the Filter card. Color-blindness is a visual disability that affects the eyesight
4. Also filter out nulls by excluding them from the data by abilities of one in ten men and a smaller group of women. You
clicking on the null values at the bottom of the chart may be color-blind yourself or work with someone who is, or
and selecting Filter data. you may not even realize that this impairment is among your
colleagues and peers. If you look at the diagram in Figure 17, You update the filled map in Figure 15 to use a diverging
you can see how orange and blue navigate around issues with Orange-Blue color scale with a very light gray serving as the
vision impairment pretty easily. Green and red, on the other color representing the midpoint. Although blue represents
hand, look the same for those with color-blind impairments. lower infant mortality rates and orange represents high infant
Also, remember that, like, many other disabilities, it occurs in mortality rates, the key part about setting up this color scale
a spectrum rather than an absolute impact. is selecting what value to use as the midpoint (Figure 20).
Accounting for those with color-blindness can serve as a In 2015, the country of Angola experienced the highest infant
starting point to selecting your own color palette. Tableau mortality rate of all the countries, at 96 deaths in the first two
has a color palette that you can see in Figure 18, specifically years of a baby’s life for every 1000 live births. I decided to set
offering ten color options to choose from. the center or midpoint of the color scale to this rate because
it allows the viewer to put in context how historical infant
You want to give a unique color for each region so that even mortality rates across all countries compare to today. It allows
those who are colorblind can distinguish the regions in the the viewer to see that although unfortunately Angola still lags
line charts, as seen in Figure 19. behind other countries in population health in today’s world,
1. Go to Sheet 2 and click on the Color Marks card. As you see in Figure 22, although all the countries in the most
2. A dialog box opens up where you select the Orange- recent time frame of 2010 to 2015 have better infant survival
Blue color scheme, and then select to reverse the col- rates than Angola (indicated with the blue cell color), when
ors so that blue indicates lower rates and orange indi- you look back at historical trends for these rates, some of the
cates higher rates (Figure 20). most developed countries today, like Japan and Singapore,
3. To change the midpoint that the color scale uses, go to had higher infant mortality rates only fifty years ago than
the Advanced options and put a check mark next to the Angola does today. Even developed European countries, like
center options, where you can now type in 96 as the France, Germany, and Austria, also have much lower rates.
value to center the color scale. Although you may lament about the difference between the
the Year of Year from the list, where you now see the down, which indicates an improved population health out-
filter on the far right. look. Similar to the way you set up the blue-orange color
7. Select this filter container, click on the down arrow, scale for the filled map and highlight tables in Figure 21
and choose Multiple Values (dropdown). Then click on and Figure 22 with the highest mortality rate in 2015 as
the down arrow again, select Floating, which means the midpoint in the diverging color scale, you can also use
that you can move the filter over the map to select the a reference line as another way for the viewer to analyze
year, and you can drag it over to the bottom of the map these rate trends. In 1950, you can see that the healthiest
where it doesn’t directly sit on top of any countries in region, Europe, had an infant mortality rate of 58.9 as you
the map. see in Figure 27. By setting a constant reference line at this
point on the y-axis, you can see that although other regions
Adding Elements of Analysis may lag behind Europe in terms of relative improved health
In the line chart in Figure 19, you saw that since 1950, outcomes, you can use this number as a benchmark to show
average infant mortality rates across all regions trend what you could call a time delay in this trend
9. Make sure that you can see all your visuals. The best Now that you’ve set up the dashboard, you can put yourself in
way to do this is to make sure to leave enough white the position of the user and test it out. In Figure 32, you see
space between the legend fields and the visuals, and Asia selected as the region in the line chart legend. This creates
then upload to Tableau Public Online to make sure a new view of the data that highlights key trends and analysis
it fits as you anticipated. If it doesn’t, go back to the for the Asia region. You can also select a single year in the map
dashboard and make adjustments based on what you to see the Asian countries’ health for that year. Choosing Asia
saw pushed out of place. This make take a little bit of filters all three charts, and you can see in the highlight table
practice! the disparity between the rankings within the Asian countries.
You maximize your dashboard’s influence by taking the ini- I encourage you to take these best practices techniques
tial Tableau dashboard and strategically making changes and use some creativity to set up and experiment with vi-
to update the design, formatting, and interactivity. This, sual options, then see how the users respond and go from
in turn, increases the user’s understanding and interac- there!
tions with the dashboard interface and the likelihood they
will use it by letting them take ownership in changing the Helen Wall
views. Designing an effective dashboard gives flexibility.