Sie sind auf Seite 1von 51

Data Analytics and Visualization 1

Dr. Chang Yun Fah

MEME19403 Data Analytics and Visualization


Module Three: Visualization with Dashboard
Instructor: Dr. Chang Yun Fah

The ability to draw statistical charts and diagrams is a basic skill required by many people. A
successful presentation is not only relying on a good communication skills but also requires
the skill to apply attractive graphics to convey the messages in a clear and professional manner.
An educator, for example, uses histogram to deliver the concepts related to normal distribution.
A researcher prefers to summarize his or her research findings in a simple but compact diagram,
while a businessman usually finds that charts and diagrams are more effective in elaborate the
business ideas or information.

Despite of many people are using graphical presentations in their daily works, not many of
them know how to draw a simple graph manually. This is one of the reasons why statistical
packages are so demanding nowadays, it provides a simple way to generate various graphical
representations.

There are many commercial statistical packages available in the market such as SPSS, Minitab,
SAS, S-Plus and Matlab. However, the price for those commercial statistical packages may not
be affordable by many small and medium enterprises (SME). Free statistical packages like R-
programming and Python are good alternative for SME but it could be a nightmare to those
without programming skills. Another limitation of these statistical packages is that they provide
only standard charts and diagrams, and the users are only allow to edit the basic display of the
graphs.

What if the user wants to draw a chart that is not in the standard chart list? Can the user design
a new chart by combining the standard charts? Unfortunately, the existing statistical packages
provide no solution for these problems.

This module recommends the use of Microsoft Excel for two reasons;
(i) most users have Microsoft office installed, this will not cause any additional cost to the user.
(ii) Microsoft Excel provides very attractive graphical features, and it allows user to design a
new graph from the standard charts.

Throughout this module, we provide a step by step guidance on how to use Microsoft Excel
version 2013 and onward to construct common charts such as bar-chart, radar chart, line chart,
pie chart etc. and to build their own special charts or diagrams. You will also learn how to use
PivotTable and Slicer in MS Excel to build your own dashboard in communicating your
messages.

1) Some Good Practice in Designing Charts


1.1) Why use Graphical Presentation?
The use of charts and diagrams as a method to express ideas has a very long history. People
use various graphical representations to visualize abstract concepts or complicated information.
Graphical representation is a convenient and simple way of describing data. As in financial
reports, graphical representation could have advantage of discriminate result and time for
Data Analytics and Visualization 2
Dr. Chang Yun Fah

making decision than financial balances or ratios and tabular representation (Volkov & Laing,
2012).

While there are many reasons for one to use graphical presentation, the Business
Communication Articles (Rasel, 2013) summarizes some advantages of graphical
representation of data. We highlight 6 useful points here:
[1] Acceptability: it is acceptable to busy persons because it helps to avoid wastage of
time by highlighting the key points of report.
[2] Comparative Analysis: information can be easily compared and quick to obtain
understanding and attention.
[3] Less Cost: it summarizes the huge information in short but catchy view to make the
report understandable.
[4] Decision Making: business executive can view the graphs at a glance and can make
decision very quickly.
[5] Logical Ideas: it presents the information in a logical way.
[6] Helpful for less literate audience: less literate user can understand graphs easily
because it does not involve language skills.

1.2) What is a Good Graphical Representation?


The Encyclopaedia of Public Health (Kirch, 2008) defines graphical representation as a visual
display of data and statistical results. Edward Tufte, a great master of visual chart concluded 3
elements of good graphical representation, namely
(i) True: it is able to precisely transfer the truth of information
(ii) Concise: it uses the minimum space and time to display the largest amount of information
(iii) Rich: it include multiple ideas of a single purpose

Here, we give a more precise definition of graphical representation:


“A good graphical representation is a simple, systematic and purposive visual
display of data and statistical results.”

From this definition, we understand that a graphical representation is a visual display of data
or statistical results. Visual displays as shown in Figure 1.1 are not a good graphical
representation of data or statistical results. Figure 1.1 (right) does not provide any information
from the data, while Figure 1.1 (left) may provide certain statistics such as number of birds and
number of horses, however, they are too complicated and not in a systematic way.

Figure 1.1: Visual displays that are not graphical representation.


Data Analytics and Visualization 3
Dr. Chang Yun Fah

On the other hand, Figure 1.2 carries plenty statistical information, but it has too many focuses
(purposes) and not systematic. It is not a good graphical representation.

Figure 1.2: Bad graphical representation as it is too complicated.

Hence, a good graphical representation simplified the data in a systematic way and only focus
on one purpose. Moreover, the graphical representation not only provide the audience a clear
picture of the information, but it also able to help the audience in making decision from these
information.

“The goal of any chart, graph or information graphic, however, is not merely to
communicate clear, dramatic statistics. Instead, its real job is to tell a story that aids
decision-making.”
Edward Turte

2) Standard Charts in Excel


All statistical packages provide a standard list of charts and diagrams for the users. In Microsoft
Excel, there are 11 types of charts and diagrams provided, each has a few alterations. Basically,
MS Excel classified all charts into two categories, i.e. charts with orthogonal coordinate, and
charts with polar coordinate. The former category refers to charts that plotted on orthogonal
X-axis and Y-axis (and Z-axis for 3-D graphs), such as column chart, bar chart, line chart, area
chart, scatter plot, stock chart, bubble chart and surface chart. The latter category refers to
charts that plotted on 360 degrees’ plane, such as radar chart, pie chart and doughnut chart.

2.1) Column Chart


Column chart are rectangular bars with the height representing different data points’ value
(HTML5 JavaScript Charts, 2013). It is useful for showing data changes over a period of time
or for illustrating comparisons among items. Three types of column charts provided in MS
Excel (Figure 2.1), namely (i) clustered column, (ii) stacked column, and (iii) 100% stacked
column.

Other than 2-D rectangular bars, MS Excel also provides different shapes such as 3-D bars,
cone, cylinder, and pyramid.

2.2) Bar Chart


Bar chart is the same as column chart with interchanged horizontal axis and vertical axis
(Figure 2.1). It has clustered bar, stacked bar, 100% stacked bar, and various shapes.
Data Analytics and Visualization 4
Dr. Chang Yun Fah

Figure 2.1: Column and bar charts.

2.3) Line Chart


A line chart displays a series of continuous data points over time and connected by straight line
segments. It is ideally for showing trends with equal time interval. Based on the MS Excel help
menu, line chart is recommended when the (ordered) categorical labels are text and if there are
multiple series. For one series or there are more than ten numeric labels, then scatter plot will
be recommended. There are three types of line chart (Figure 2.2) with or without markers,
namely (i) line, (ii) stacked line, and (iii) 100% stacked line. There is only one option for 3-D
line chart.

Figure 2.2: Line chart.

2.3) Pie Chart


A pie chart (Figure 2.3) is a circle divided into different sectors; each sector represents a
quantity from the data. The size of the sector is proportional to its central angle and area with
the total of 360 degrees. There are four types of pie chart (Figure 1.4), namely (i) pie and 3-D
pie, (ii) exploded pie and 3-D exploded pie, (iii) pie of pie, and (iv) bar of pie.
Data Analytics and Visualization 5
Dr. Chang Yun Fah

2.4) Doughnut Chart


Doughnut chart is a ring with a blank centre. Similar to pie chart, the ring of doughnut chart is
divided into different sectors; each sector represents a quantity from the data. The size of the
sector is proportional to its central angle and area with the total of 360 degrees. There are only
two types of doughnut chart (Figure 2.3), which are doughnut and exploded doughnut.

Figure 2.3: Types of pie chart and doughnut chart.

2.5) Scatter Plot (X-Y chart)


Scatter plot shows the relationship between two variables for a set of dataset. The horizontal
axis indicates the value of one variable, and the vertical axis indicates the value of another
variable from the same observations. MS Excel (Figure 2.4) provides five choices of scatter
plot, they are (i) scatter with only markers, (ii) scatter with smooth lines and markers, (iii)
scatter with smooth lines, (iv) scatter with straight lines and markers, and (v) scatter with
straight lines.

2.6) Bubble Chart


Bubble chart uses bubble-like symbols to indicate data values. It has similar concept with
scatter plot where the horizontal axis indicates the value of one variable, and the vertical axis
indicates the value of another variable from the same observations. The size of the bubble
indicates the value of the third variable. MS Excel only provides two choices for bubble chart,
namely bubble and bubble with 3-D effect (Figure 2.4).

Figure 2.4: Scatter and Bubble plots.


Data Analytics and Visualization 6
Dr. Chang Yun Fah

2.7) Radar Chart (or Spider Chart, Star Chart)


Radar chart is a graphical method of displaying multivariate data in the form of a two-
dimensional chart of three or more quantitative variables represented on axes starting from the
same point. There are three types of radar chart in MS Excel (Figure 2.5), namely (i) radar, (ii)
radar with markers, and (iii) filled radar.

Figure 2.5: Radar chart.

2.8) Area Chart


An area chart shows the total value across a trend by colouring the area under the line chart.
There are three types of area chart, namely (i) area and 3-D area, (ii) stacked area and its 3-D
version, and (iii) 100% stacked area and its 3-D version (Figure 2.6).

Figure 2.6: Area chart.

2.8) Surface Chart


Surface chart is a three-dimensional surface that connects a set of data points. It allows the user
to find optimum combinations between two sets of data, in which the colours and patterns in a
surface chart show areas that contain the same range of values. Basically, MS Excel (Figure
2.7) provides two types of choices, which are 3-D surface (or wireframe 3-D surface) and
contour (or wireframe contour).
Data Analytics and Visualization 7
Dr. Chang Yun Fah

Figure 2.7: Surface chart.

2.9) Stock Chart (or Candle Stick Chart)


Stock chart is used to represent price movements or market emotions surrounding a stock in a
given time span. Stock chart looks like a boxplot with market’s opening and closing prices
form the real body and a vertical line represents the high and low values of a specific day. MS
Excel (Figure 2.8) provides four options for stock chart, that are (i) High-Low-Close, (ii) Open-
High-Low-Close, (iii) Volume-High-Low-Close, and (iv) Volume-Open-High-Low-Close.

Figure 2.8: Stock or Candle Stick chart.

MS Excel version 2016 provides more chart choices for users. These additional charts are Map,
Treemap, Sunburst, Histogram, Box & Whisker, Waterfall, and Funnel. All these chart types
can be classified into two main categories based on whether there are plotted on an orthogonal
coordinate (it is similar but not the same as Cartesian coordinate) or polar coordinate. Figure
2.8 shows the classification of the charts.
Data Analytics and Visualization 8
Dr. Chang Yun Fah

Classification of Chart

Orthogonal Coordinate Polar Coordinate

Points and Lines Area

Line chart Column chart Pie chart


Scatter plot Bar chart Doughnut chart
Area chart Radar chart
Surface chart
Bubble chart
Stock chart
Figure 2.8: Classification of charts.

3) Create Combined Charts


3.1) Which type of charts can be combined?
The aim of this section is to introduce the construction of special charts that combined two or
more basic charts in MS Excel. To do so, we need to know which two types of charts can be
combined, and which two type of charts cannot be combined. Sad to say, not all type of charts
can be merged together. First, a chart cannot be combined with another chart from the same
type. For example, a cluster column chart cannot combine with stacked column chart. Besides,
stock chart, bubble chart and surface chart cannot (not suitable) be combined with any other
chart. For certain reason, pie chart and doughnut chart cannot be merged too. Figure 3.1
provides a summary of which type of charts can be combined (blue colour), and cannot be
combined (white colour).

Chart Column Line Bar Pie Stock Doughnut Bubble Scatter Area Surface Radar
Column
Line
Bar
Pie
Stock
Doughnut
Bubble
Scatter
Area
Surface
Radar
Figure 3.1: Charts that can be combined and cannot be combined.

You may try out to combine 3 types of chart together. For example, Figure 3.1 shows that any
two of pie chart, column chart and bar chart can be combined with each other, but three of them
cannot be added at once.
Data Analytics and Visualization 9
Dr. Chang Yun Fah

Luckily, MS Excel version 2013 onwards provide an additional Combo chart function (Figure
3.2). This function allows user to create combined chart easily with some basic charts.

Figure 3.2: Combo chart function in Excel 2016.

3.2) Ordering of Series


For a chart with more than one series values, MS Excel uses the “last in first out” (LIFO)
concept to arrange them. Figure 3.3, for example, there are three series values in the clustered
column chart, namely “Son”, “Daughter”, and “Total”. These series were entered in the
sequence of “Son”, Daughter” and “Total”. When the series were overlapped with each other,
then it is obvious that the series last entered (Last In) into the chart “Total” will have the bars
on top of the other series (First Out), while the first series entered (First In) into the chart “Son”
is hiding at the back of the other series (Last Out).

Number of Children Per Family


60.0%
50.0%
Percentage

40.0%
30.0% Son
20.0% Daughter
10.0% Total

0.0%
1 2 3 4
Number of Children

Figure 3.3: Display sequence of series entered the chart with LIFO concept.
Data Analytics and Visualization 10
Dr. Chang Yun Fah

3.3) Ordering of Charts


What is the order if there are more than one type of charts displayed on the same chart area?
The LIFO concept does not apply here but the order of different charts depends on the chart
classification showed in Figure 2.8. Referring to Figure 3.4 using stacked column chart, change
the Series2 to line chart, the Series3 to area chart, and the Series4 to scatter plot and the Series5
to pie chart, respectively.

90.0%
80.0%
70.0%
60.0% Series1: Column

50.0% Series2: Line


40.0% Series3: Area
30.0% Series4: Scatter
20.0% Series5: Pie
10.0%
0.0%
1 2 3 4 5

Figure 3.4: Column chart for 5 series.

After changing the chart types, it can be observed from Figure 3.5 that the ordering of the charts
has been changed as well. Now, the Pie chart is at the most underneath layer, followed by Area
chart, Column chart, Line chart, and the first front layer is the Scatter plot with smooth line.
This sequence of charts will not change even we re-order the series sequence. In general, we
can conclude the order of charts based on the following five rules:
a) Charts of orthogonal coordinate always in front of charts of polar coordinate.
b) In the orthogonal coordinate, point and line series always in front of area series.
c) From the point series, Scatter plot is in front of Line chart.
d) From the area series, bar/column chart is in front of the area chart.
e) In MS Excel 2007/2010, the Doughnut chart from polar coordinate is in front of pie
chart.

90.0%
80.0%
70.0% Series5: Pie
60.0%
50.0% Series3: Area
40.0% Series1: Column
30.0% Series2: Line
20.0%
10.0% Series4: Scatter
0.0%
1 2 3 4 5

Figure 3.5: Order of different chart types.


Data Analytics and Visualization 11
Dr. Chang Yun Fah

4) Information Carried in the Charts


There is often some useful information carried in each dataset. However, it is not easy to fully
understand this information from the data itself, especially if you have an unstructured dataset.
We need some techniques to extract this information. The graphical techniques provide a
simple and good choice for many data analysts. The following section discusses three types of
information you may gain from a chart or diagram. These 3 types of information are value of
data points, differences between data, and change of trend in data. It helps the user to choose
what kind of charts that is best described the data. For example, if the user wants to see the
changes of total sales in the past 12 months, then he or she may choose line chart that shows
the total sales on each month and the trend for the past one year. However, if the user wants to
compare the total sales of a month with the targeted total sale, then column chart is more
suitable.

4.1) Value of data points


The most basic information we can obtain from a chart or diagram is the value of certain data
points. This value can be any observed value of a subject, frequency of a group of subjects, or
any other statistics such as mean, median, mod and sum amounts. Most of the graphical
representations not only able to indicate the value of data points, but they can also display other
information. However graphical representation can become not necessary if the purpose of the
presentation is to display the value of data points (Figure 4.1). In such case, using table is more
suitable than chart.

Number of participants Number of


Region
250 participants
200 Selangor 210
150
Perak 140
100 210 200
50
140 Pahang 80
80 75
0 Melaka 75
Selangor Perak Pahang Melaka Johor
Johor 200
Figure 4.1: Value of data points. Bar chart (left) and table (right).

4.2) Differences between data


Most data analyses involve comparisons of data from different samples such as an economist
wants to compare the Gross Domestic Product (GDP) among ASEAN countries; a manager is
interested to find out the price differences of a product quoted by different suppliers, and many
others. There are two level for doing such comparisons. Use the GDP case for example; one
may perfomr direct comparison of the quantities as in Figure 4.2. From this figure, you will
know the GDP nominal per capital for each country. From this direct comparison, you will also
easily notice that Singapore has the highest GDP nominal per capital among ASEAN countries
followed by Brunei, but it takes some times to identify the countries that perform better than
Malaysia or otherwise.
Data Analytics and Visualization 12
Dr. Chang Yun Fah

GDP Nominal Per Capital Among ASEAN Countries


60,000 51,162
50,000 41,703
USD 40,000
30,000
20,000
10,304
10,000 3,592 5,678 2,614 1,528 835 934 1,446
0

Country

Figure 4.2: GDP nominal per capital among ASEAN countries.

Another ways of doing comparisons is to look at the difference of the quantities as in Figure
4.3. It is now easy to know which countries perform better or worse than Malaysia and the gaps
between Malaysia and these countries. If we compare the two figures and Table 4.1, it is
obvious the graphical presentation is more attractive and easily read.

Differences of GDP Per Capital Between Malaysia and


Other ASEAN Countries
50,000
40,000
30,000
USD

20,000
10,000
40,858 31,399
0
-6,712 -4,626 -7,690 -8,776 -9,469 -9,370 -8,858
-10,000

Country

Figure 4.3: Differences of GDP per capital between Malaysia and other ASEAN countries.
Data Analytics and Visualization 13
Dr. Chang Yun Fah

Table 4.1: Comparison of GDP nominal per capital among ASEAN countries.
GDP Nominal Per Indonesia Thailand Malaysia Singapore Philippines Vietnam Myanmar Brunei Cambodia Laos
Capital (USD) 3,592 5,678 10,304 51,162 2,614 1,528 835 41,703 934 1,446
Indonesia 3,592 2,086 6,712 47,570 -978 -2,064 -2,757 38,111 -2,658 -2,146
Thailand 5,678 -2,086 4,626 45,484 -3,064 -4,150 -4,843 36,025 -4,744 -4,232
Malaysia 10,304 -6,712 -4,626 40,858 -7,690 -8,776 -9,469 31,399 -9,370 -8,858
Singapore 51,162 -47,570 -45,484 -40,858 -48,548 -49,634 -50,327 -9,459 -50,228 -49,716
Philippines 2,614 978 3,064 7,690 48,548 -1,086 -1,779 39,089 -1,680 -1,168
Vietnam 1,528 2,064 4,150 8,776 49,634 1,086 -693 40,175 -594 -82
Myanmar 835 2,757 4,843 9,469 50,327 1,779 693 40,868 99 611
Brunei 41,703 -38,111 -36,025 -31,399 9,459 -39,089 -40,175 -40,868 -40,769 -40,257
Cambodia 934 2,658 4,744 9,370 50,228 1,680 594 -99 40,769 512
Laos 1,446 2,146 4,232 8,858 49,716 1,168 82 -611 40,257 -512

4.3) Change of trend in data


The relation between chart’s elements determines whether they exist individually or as a whole.
Visually, readers are more interested to view the overall trend when a group of related elements
are put together. Examples of these are the revenue of a company for the past ten years and the
stock index. Figure 4.4 indicates the historical prices of KLSE from 19 October 2015 to 22
January 2016. In this case, the stock price for a day is related to the previous prices and it forms
a trend in the long run. Hence, reader of the chart is more interested to view the market
performance (either upward trend or downward trend) in the future, instead of the market
historical prices.

KLSE index
1,720.00
1,700.00
1,680.00
1,660.00
1,640.00
1,620.00
1,600.00
1,580.00
Oct 19, Nov 2, Nov 17, Dec 1, Dec 15, Dec 31, Jan 15,
2015 2015 2015 2015 2015 2015 2016

Figure 4.4: KLSE index from 19 Oct 2015 to 22 Jan 2016.

4.4) Steps in Drawing Combined Charts


There is no standard procedure in constructing a chart. Basically, everyone can have their own
ways in constructing the desired chart as long as it served the purpose. Nevertheless, it is always
good to have some guidelines to help those unfamiliar with charts. Below are some steps in
making a combined chart.
a) Understanding the purpose
The purpose of study defines the type of data being collected and the appropriate
graphical representation to be used. For example, line chart is more suitable than pie
chart if the purpose of study is to observe the trend of the observed data.
Data Analytics and Visualization 14
Dr. Chang Yun Fah

b) Understanding the data collected


There are different ways a data set can be recorded for the same purpose of study. The
monthly income, say for instance, can be recorded as continuous data (the actual income
value) or categorical data (different levels of income). Boxplot is a good choice for
continuous data but not for categorical data.

c) Sketching idea of chart on paper


After understanding the purpose of analysis and your data, it is highly recommended to
sketch the designed combined chart on a paper before draw it in MS Excel. This step
helps the designer to determine the basic charts and information needed to draw the
combined chart, to decide on the arrangement of these basic charts and to have a better
idea of the visual presentation of the chart such as colours matching, axes or legend
positioning.

d) Preparing the necessary information


The raw data collected are usually not directly applicable for drawing chart. The
designer needs to compile and convert these raw data into a more meaningful table, i.e.
frequency table or contingency table. Besides, the designer may also need to prepare
some additional information which is not part of the raw data. For example, the column
Help3 in Table 2.2, Chapter 2 was created as the special type of data labels for the
combined chart.

e) Drawing the chart.


The final step, of course, is to draw the combined chart that you designed on the MS
Excel platform. This step requires patient, you may need to do some minor amendments
on your initial idea before finalizing the chart.

5) Create compound charts


The compound chart here is different from the combined chart we discussed in the previous
section. The combined chart is to put two or more charts overlapped together and each chart
maintain its unique features in the combined chart. While compound chart is the synthesized
version of two or more charts to create a new type of chart. Thus, the basic features of the
individual chart may be or may not be seen in the compound chart. The illustrations in this
section were using MS Excel 2010.

5.1) Indexing of a continuous scale on a dashboard chart


Large sample size is a basic requirement for classical statistical analysis. Likewise, majority of
the charts requires a large amount of data before they can be made. For example, a bar chart
with frequencies 35, 20, 12, 48, and 15 summarizes the characteristic of 130 observations.
However, in some situations, we may only have one observation obtained from a continuous
scale. In this section, we will focus on developing dashboard chart (also called Gauges chart or
Speedometer Tachometer chart) to indicate the position of this observation on a continuous
scale. There are two types of dashboard chart; one of them uses pie chart and another uses
doughnut chart. Since a dashboard chart only have one pointer, these charts are usually suitable
for the case of one observation.
Data Analytics and Visualization 15
Dr. Chang Yun Fah

Scenario I:
Key Performance Indicator (KPI) is a measure of achievement of an individual or entity in
meeting the targeted objectives. KPI has been used in many areas ranging from target setting
for employee, company’s annual performance assessment, or governmental entity’s
performance rating. Does a student have KPI to be achieved? The answer is certainly. A
student’s KPI is to achieve better academic result on his or her study. For all undergraduate
programmes in a local university, honours classification shall be awarded based upon cut-off
point Cumulative Grade Point Average (CGPA) as shown in Table 5.1.

Table 5.1: Honours classification based on CGPA.


B C
2 Classification of Honours CGPA
3 Fail 0.0000 – 1.9999
4 Third Class 2.0000 – 2.1999
5 Second Class (Lower Division) 2.2000 – 2.9999
6 Second Class (Upper Division) 3.0000 – 3.4999
7 First Class 3.5000 – 4.0000

According to this honours classification, the maximum CGPA is 4.0000. A student who obtains
a CGPA below 2.0000 will not be awarded with a degree. Student who scored 2.0000 to 2.1999
will be awarded a third-class degree, scored of 2.2000 to 2.9999 will be awarded a second
lower class, scored of 3.0000 to 3.4999 will be awarded a second upper class and scored of
3.5000 to 4.000 will be awarded with a first class honour.

Suppose we have a student scored 2.5400 in his study. Our aim is to display this single value
on a continuous scale from 0.0000 to 4.0000. Figure 5.1 shows the dashboard chart for this
observation developed from a pie chart.

2.00 2.20
2.54
3.00

3.50

0.00 4.00

CGPA Indicator

Figure 5.1: Dashboard chart with one pointer.

5.1.1) Data Preparation


The development of the first dashboard chart consists of 2 components. The first component is
a semi-circle that obviously can be created from pie chart. The second component is the pointer
that will move from lowest scale 0.00 to highest scale 4.00 based on the only one observation.
The pointer is also constructed using a pie chart.
Data Analytics and Visualization 16
Dr. Chang Yun Fah

The CGPA can be divided into 5 levels of honours as given in Table 5.1. These 5 categories
will form the dashboard chart, which takes the upper half of the pie chart. The second half of
the pie chart will be represented by an empty segment.
 Create a new category in the cell B8 and name it as “Empty” (Table 5.2).
 Upper Boundary: create a new column “Upper Boundary” with boundary values in
D3:D7. The cell D8 has a value of double the size of the last boundary value.
 Size of segments: since a pie chart has 360 , we convert the difference of upper
boundary values to degrees in column E using the following formula:
360 ×    −    
 =
       
!"× #.%%%%& !"× *.#%%%&#.%%%%
For example, cell 3 = = 90 and cell 4 = = 9, until
' '
!"× '.&,.
cell 8 = '
= 180. This information will be used to construct the
dashboard.
 Observation value: we create a cell contains the observation value 2.54 in G3 as Score.
The user can change this value and the dashboard’s pointer will update accordingly.
 Pointer: to create one pointer in the second pie chart, we first convert the score 2.54 to
!"×$0$! !"×*.1,
degree by .3 = = = 114.3 . This value in cell H3 controls the
' '
position of the pointer (distance from 0.00). The value in cell H4 is 1.0, which will
determine the thickness of the pointer. Lastly, cell H5 set the remaining part of the pie
chart, and .5 = 360 − .3 − .4.

Table 5.2: Additional data for dashboard chart.


B C D E F G H
Classification of Upper
2 CGPA Size Score Pointer
Honours Boundary
3 Fail 0.0000~1.9999 1.9999 90.00 2.54 114.3
4 Third Class 2.0000~2.1999 2.1999 9.00 1.0
Second Class
5
(Lower Division) 2.2000~2.9999 2.9999 36.00 244.7
Second Class
6
(Upper Division) 3.0000~3.4999 3.4999 22.50 Total 360
7 First Class 3.5000~4.0000 4.0000 22.50
8 Empty 8.0000 180.00
9 Total 360.00

5.1.2) Develop Dashboard


We will construct the dashboard using pie chart. The following steps are to be followed:
 On the Insert menu, click on Pie tab and choose a 2-D pie without explode effect (Figure
5.2).
 Once you have created the chart area, the Chart Tools contextual tab will be activated.
Select Design in Chart Tools as shown in Figure 5.3 (top).
 Click the Select Data and the dialog box as shown in Figure 5.3 (bottom left) will appear
for you to select data source. In the dialog box, click Add to create “Series1”. Select
cells E3:E8 into the Series Values in Edit Series dialog box (Figure 5.3 bottom right).
A pie chart as shown in Figure 5.4 will be created.
Data Analytics and Visualization 17
Dr. Chang Yun Fah

Figure 5.2: Creating chart area.

Figure 5.3: Adding data series to the chart.

1
2
3
4
5
6

Figure 5.4: Pie chart with six segments.


Data Analytics and Visualization 18
Dr. Chang Yun Fah

 The biggest left segment in the pie chart representing the empty cell. We convert the
colour of this segment into No Fill. Choose Format tab in Chart Tools contexture menu,
and click on the Shape Fill (Figure 5.5 left) and select No Fill in the colour panel (Figure
5.5right).
 Next, select segments 1 to 5 one by one and convert their colours to your desired colours
as shown in Figure 5.6.

Figure 5.5: Change the chart colours.

1
2
3
4
5
6

Figure 5.6: Pie chart after changing colours.

 The created dashboard is facing on the right side of the chart area. In order to rotate it,
we select the pie chart and right click the mouse to get the panel shown in Figure 5.7
(left). Click the Format Data Series, the right dialog box will appeared. In Series
Options, change the “Angle of first slice” to 270 as shown in Figure 5.8. This value can
be altered to rotate the dashboard into a different direction.
Data Analytics and Visualization 19
Dr. Chang Yun Fah

Figure 5.7: Dialog box to rotate the pie chart.

1
2
3
4
5
6

Figure 5.8: Rotated pie chart.

 The next step is to add the scale levels into the pie chart using data labels. Go to Chart
Tools contexture section and choose Layout menu (Figure 5.9). Under the Data Labels
tab, select Outside End and the chart in Figure 5.10 (left) will be created
 Change the data labels’ value “180.00” to “0.00”, “90.00” to “2.00”, “9.00” to “2.20”,
“36.00” to “3.00”, “22.50” to “3.50”, and “22.50” to “4.00”. Move these data labels to
their respective boundary lines (Figure 5.10 right).
Data Analytics and Visualization 20
Dr. Chang Yun Fah

Figure 5.9: Inserting data labels.

9.00 2.00 2.20


36.00
90.00 1
3.00
22.50
2
3.50
22.50 3
0.00 4.00
4
5
6
180.00
Figure 5.10: Pie chart with data labels. Original data labels (left), modified data labels (right).

5.1.3) Create Pointer


After developing the dashboard, we need to create a pointer on it. Take note that this pointer is
not static, but it should be automatically updated once the value in cell G3 changed.
 Create second pie chart: go to Chart Tools section to select Design menu. Click on the
Select Data tab (Figure 5.11). Add the “Series2” by selecting values from H3:H5.
 Go to Data Select Source and move “Series2” up on top of “Series1” using the
triangular button next to Remove (Figure 5.12). The second pie chart in Figure 5.13
will be displayed.

Figure 5.11: Inserting series2 to create pointer.


Data Analytics and Visualization 21
Dr. Chang Yun Fah

Figure 5.12: Interchange the sequence of series1 and series2.

114.3 1.00

244.70

Figure 5.13: Pie chart obtained from series2.

 Change the segments with green and blue colours to No Fill. This can be done by
selecting No Full in the colour panel (Figure 5.14 right), under Shape Fill tab of Format
menu. Repeat the same process to change the colour of the smallest segment (with data
label 1) to any desired colour. This smallest segment will be served as pointer for the
dashboard chart.
 Delete the data labels “244.70” and “114.3”. Highlight the data label “1.00” and go to
the function to select cell G3 or type 3 ≔ ℎ1! $7$3 (Figure 5.15).
 Rotate the pointer: we need to rotate the pointer to synchronize it with the dashboard.
Right click the mouse by pointing the curser on the chart and select Format Data Series
to obtain the dialog box as shown in Figure 5.16. Under Series Options, change the
Angle of the first slice to 270.
 Lastly, add the chart title “CGPA Indicator” by clicking the Chart Title table in Layout
menu (Figure 5.17). Put the title above the chart, move it to the bottom of chart after
creating it.
 Figure 5.18 displays the completed dashboard chart.
Data Analytics and Visualization 22
Dr. Chang Yun Fah

Figure 5.14: Change the colours of second pie chart.

Figure 5.15: Set the pointer indicator value to cell G3.

2.00 2.20 2.54

3.00

3.50

0.00 4.00
Data Analytics and Visualization 23
Dr. Chang Yun Fah

Figure 5.16: Rotate the pointer.

Figure 5.17: Add chart title.

2.00 2.20
2.54
3.00

3.50

0.00 4.00

CGPA Indicator

Figure 5.18: Dashboard chart with one pointer.


Data Analytics and Visualization 24
Dr. Chang Yun Fah

5.1.4) Dashboard Chart with two pointers


Basically, a dashboard chart can have several pointers to indicate the achievement of different
persons or entities. This section briefly explains an example of dashboard chart with two
pointers, but it can be extended to more than two.

Referring to scenario described in Section 5.2. Suppose that we have two students scored
1.5000 and 3.2500 respectively in their studies. We would like to compare their performance
on the same dashboard.

Column B to Column E in Table 5.2 will be remained unchanged. Change the information in
Column G and Column H to Table 5.3 as shown below:

Table 5.3: Additional data for two pointers.


G H
2 Score Pointer
3 1.5000 67.5
4 1
5 3.2500 78.75
6 1
7 211.75
8 360

 The actual CGPA score for the two students are recorded in cell G3 for 1.5000 and cell
G5 for 3.2500. For more than two scores, the next CGPA values will be recorded in cell
G7, G9 and so on. For simplicity, we will put the smaller CGPA value before the larger
CGPA value.
 For the Pointer (Column H), we convert the CGPA score to 360 degrees by
360 × 879:    ;ℎ   − 879:    ; − 1ℎ  
 =
       
!"× #.1& !"× !.*1&#.1
For example, cell .3 = = 67.50 and cell .5 = =
' '
78.75. These degree values will control the position of different pointers.
 In Column H, cells H4 and H6 (or H8, H10 etc. if there are more than 2 students) will
be recorded as “1” to represent the thickness of the pointers. In the last two cells, H8 is
“360” and H7 is obtained by .7 = 360 − .3 − .4 − .5 − .6 = 211.75.

Once the data are ready, we repeat the same steps explained in Section 5.1.1 and Section 5.1.3
using the information in Table 5.3. Figure 5.19 shows the dashboard chart with two pointers.
Data Analytics and Visualization 25
Dr. Chang Yun Fah

1.50 2.00 2.20


3.00
3.25
3.50

0.00 4.00
CGPA Indicator

Figure 5.19: Dashboard chart with two pointers.

The following is another example of dashboard chart created using Doughnut chart and Radar
chart in Excel.

5.2) Distributing multiple observations on a map


Map is a power graphical technique preferred by many users to display demographic data
associated with geographical information. The launch of Google Maps (Figure 5.20 top)
provides a simple and convenient tool for users to find information on a selected map. Yet, it
is not easy to develop a customized map with uncommon information using Google Maps.
There are also online websites that provide free maps such as World Maps (http://mapchart.net/)
as shown in Figure 5.20 (bottom). This World Maps does not allow users to design their own
maps.
Data Analytics and Visualization 26
Dr. Chang Yun Fah

Figure 5.20: Google maps (top) and World Maps (bottom).

Excel provides an alternative to construct maps with various indicators based on user’s needs
and preferences. In this chapter, we will discuss how to create graphical displays called Heat
Map and Map with one or more features. We will draw map using bubble chart.

Scenario II
Some people especially those who do not have programming background may find that the
building of Geographical Map in Scenario II difficult. An easier but less attractive way of
drawing map is to use Bubble chart. Let’s build a map to indicate the Malaysian Air Quality
index.

Table 5.4: Malaysia air quality index recorded on 18th September 2015.
B E
2 State MAQ Index
3 Perlis 52
4 Kedah 60
5 Penang 110
6 Perak 95
7 Kelantan 30
8 Terengganu 30
9 Pahang 75
10 Selangor 80
11 KL 98
12 N.Sembilan 189
13 Melaka 125
14 Johor 150
15 Sarawak 205
16 Sabah 89
17 Healthy 100
18 Unhealthy 200
19 Dangerous 300

The MAQ index is recorded daily in each state of Malaysia. The index is updated twice a day
to monitor the air quality. Assuming that the MAQ index range from 0 to 300 where the air
quality is considered healthy if MAQ index is below 100. The air quality is unhealthy when
Data Analytics and Visualization 27
Dr. Chang Yun Fah

MQA index is between 100 and 200, and it is dangerous if the index is above 200. Table 5.4
shows the MQA index for all 14 states recorded on 18th September 2015 at 12.00pm. Figure
5.21 shows the map and the MQA index using bubble chart.

Malaysia Air Quality Index


recorded on 18th September 2015: 12.00pm

52
60
110 30 89
30
95

98 75 205
80 189
125 <100 <200 >300
150 Dangerous
Unhealthy
Healthy

Figure 5.21: Map indicating Malaysia air quality index on 18th September 2015.

5.2.1) Data Preparation


We created two new column, Column C and Column D in Table 5.5 as the location of the
bubbles. The axes values can be tentatively set at the beginning as we will need to adjust them
accordingly to accommodate the size of the map and position of the state. The last three rows
are optional to create additional bubbles at bottom right of the chart to show the threshold
values for each level of air quality.

Table 5.5: Additional information for Malaysia air quality index.


B C D E
2 State X-axis Y-axis MAQ Index
3 Perlis 5 285 52
4 Kedah 10 250 60
5 Penang 5 220 110
6 Perak 20 175 95
7 Kelantan 40 210 30
8 Terengganu 65 190 30
9 Pahang 55 120 75
10 Selangor 30 90 80
11 KL 32 110 98
12 N.Sembilan 40 80 189
13 Melaka 45 55 125
14 Johor 70 30 150
15 Sarawak 140 120 205
16 Sabah 175 220 89
17 Healthy 140 30 100
18 Unhealthy 160 35 200
19 Dangerous 185 40 300
Data Analytics and Visualization 28
Dr. Chang Yun Fah

5.2.2) Drawing Chart


We will first insert the Malaysia map into the Bubble chart.
 Copy or draw a Malaysia map. The background colour of the map can be remained or
removed as shown in Figure 5.22.
 Create an empty Bubble chart: go to Insert menu and select Other Charts tab (Figure
5.23).
 Insert Malaysia map: select the Bubble chart and go to the Chart Tools section as in
shown in Figure 5.24. Select Shape Fill tab under the Format menu. Then, choose
Gradient in the panel and select More Gradient to get the Format Chart Area dialog box
as shown in Figure 5.24 (right). In the Fill option, click on the “Picture or texture fill”
and choose insert from Clipboard.
 Figure 5.25 shows the Bubble chart with Malaysia map as background.

Figure 5.22: Malaysia map.

Figure 5.23: Create empty Bubble chart.


Data Analytics and Visualization 29
Dr. Chang Yun Fah

Figure 5.24: Insert Malaysia map into Bubble chart.

Figure 5.25: Bubble chart with Malaysia map as background. (bubbles are hiding behind)

Once we have inserted Malaysia map to the Bubble chart, we need to select data source to
create the bubbles. There are two ways of creating bubbles, one way is simple but it is rigid,
and another way has more flexibility.
 Simple method: in Chart Tools section, select Design menu followed by Select Data
tab. Click “Add” button in the Select Data Source dialog box (Figure 5.26). In Edit
Series dialog box, select series name, X values, Y values and bubble size as a group,
that is, select row 3 until row 19 at the same time.
 Flexible method: click “Add” button in the Select Data Source dialog box, select one
state at one time, for example, select cells B3, C3, D3 and E3 accordingly in Edit Series
dialog box for the state Perlis (Figure 5.27). Click OK button and continue with Kedah
and so on until complete select all the14 states and the three pollution status “Healthy”,
“Unhealthy” and “Dangerous”. We recommend this method as it allows user to insert
index value and state name into the bubble.
 Figure 5.28 will be obtained by using flexible method. Remove the legend from the
chart, remove horizontal gridlines, and change the background colour for bubble chart
to No Fill.
Data Analytics and Visualization 30
Dr. Chang Yun Fah

 Axes: go to Layout menu, then choose Axes tab. At Primary Horizontal (and Vertical)
Axis, click More Primary Horizontal (and Vertical) Axis Options as shown in Figure
5.29. Change the axis minimum value to 0 and adjust the maximum value to a suitable
number. Set the vertical (and horizontal) axis crosses 0.0. Once it is done, go back to
Primary Horizontal (and Vertical) Axis, and set the axes to None.
 Figure 5.30 will be obtained after adding the chart title.

Figure 5.26: Simple method to create bubbles.

Figure 5.27: Flexible method to create bubbles.


Data Analytics and Visualization 31
Dr. Chang Yun Fah

350
Perlis
300
Kedah
250 Penang

200 Perak
Kelantan
150
Terengganu
100 Pahang

50 Selangor
KL
0
-50 0 50 100 150 200 250 N.Sembilan
-50

Figure 5.28: Bubble chart created on Malaysia map.

Figure 5.29: Changing the axes values.


Data Analytics and Visualization 32
Dr. Chang Yun Fah

Malaysia Air Quality Index


recorded on 18th September 2015: 12.00pm

Figure 5.30: Bubble chart with Malaysia map.

The final step is to adjust the position of the bubbles. User can change the X-axis and Y-axis
values in Table 5.5 so that the bubbles are located at the centre or within the boundary of the
respective states.
 Add MAQ index: go to Layout menu and click Data Labels tab (Figure 5.31). User may
add both series name and bubble size into each bubble. User may also change the colour
of the bubbles.

Figure 5.31: Add information into bubbles.

 Figure 5.32 and Figure 5.33 show the Malaysia air quality index maps constructed using
simple method and flexible method, respectively. For simple method, a special
treatment is needed to insert the state name into the bubble. The bubbles’ colour can be
changed to the corresponding green, orange and red to indicate the level of air pollution.
Data Analytics and Visualization 33
Dr. Chang Yun Fah

Malaysia Air Quality Index


recorded on 18th September 2015: 12.00pm

52
60
110 89
30
30
95

75 205
98
80
189
125 >200
<100 <200
150 Dangerous
Unhealthy
Healthy

Figure 5.32: Malaysia air quality index with bubble chart (simple method).

Figure 5.33: Malaysia air quality index with bubble chart (flexible method).

A more advanced map as shown in Figure 5.34 can be developed by using some VBA codes.
MS Excel version 2013 onwards provide the build-in maps.
Data Analytics and Visualization 34
Dr. Chang Yun Fah

Perlis:
100
Kedah:
73.33

Penang: Sabah:
Kelantan:
84.62 96
85.71 Terengganu:
87.5
Perak:
45.83

Pahang:
85.71 Sarawak:
Wilayah P.: 96.77
23.08

Selangor: N.Sembilan:
77.27 62.5

Johor:
Melacca:
96.15
83.33

Figure 5.34: Geographical map showing the percentage of parliamentary seats won by the
state ruling party in MGE12.

6) Using Controls and ActiveX Controls


6.1) Enable Developer tab and Macros
The Developer and Macros are essential functions for VBA and advanced MS Excel tasks. To
activate them, we can go to File tab and select the Options as shown in Figure 6.1.

Figure 6.1: Activate Developer and Macros.

The following Excel Options dialog box (Figure 6.2) will be appeared. If you are going to
enable Developer function, click on the Customize Ribbon on the left selection bar and then
ensure the Developer box under Main Tabs on the right-hand side is checked.

If you want to enable the Macros, click on the Trust Center (Figure 6.3) on the left selection
bar, follows by Trust Center Settings button on the right-hand side. The new dialog box will
appear and select Macro Settings (Figure 6.4). You may choose any of the four types of setting
Data Analytics and Visualization 35
Dr. Chang Yun Fah

provided. It is strongly advised to select Disable all macros with notification to prevent viruses
attack.
Figure 6.2: Customize Ribbon

Figure 6.3: Trust Center

Figure 6.4: Macro Settings

6.2) Controls and ActiveX Controls


There are several types of forms that you can create in MS Excel: data forms, worksheets that
contain Form and ActiveX controls, and VBA UserForms. You can use each type of form
individually, or you can combine them in different ways to create a solution that fit your
purpose.

6.2.1) Data Form


A data form provides a convenient way to enter or display one complete row of information in
a range or table without scrolling horizontally. You may find that using a data form can make
data entry easier than moving the curser from column to column during data entry.
Data Analytics and Visualization 36
Dr. Chang Yun Fah

Excel can automatically generate a built-in data form for your data range or table. The data
form displays all column headers as labels in a single dialog box. Each label has an adjacent
blank text box in which you can enter data for each column. It can create up to a maximum of
32 columns. In a data form, you can enter new rows, find rows by navigating, or (based on cell
contents) update rows and delete rows. If a cell contains a formula, the formula result is
displayed in the data form. However, you cannot change the formula by using the data form.

6.2.2) Worksheet with Form and ActiveX controls


A worksheet is a type of form that enables you to enter and view data on the grid, and there are
several control-like features built-in in Excel worksheets; such as comments and data validation.
Cells resemble text boxes where you can enter and format them in many ways. Cells are often
used as labels, and by adjusting the cell height and width and merging the cells, you can make
a worksheet behave like a simple data entry form. Other control-like features, such as cell
comments, hyperlinks, background images, data validation, conditional formatting, embedded
charts, and AutoFilter can make a worksheet behave like an advanced form.

To make it more flexible, you can add controls and other drawing objects to the drawing canvas
of a worksheet, and combine and coordinate them with worksheet cells. For example, you can
use a list box control to make it easier for a user to select item from a list of items. Or, you can
use a spin button control to make it easier for a user to enter a number.

MS Excel has two types of controls: Form controls and ActiveX Controls. In addition to these
sets of controls, you can also add objects from the Drawing tools, such as AutoShapes,
WordArt, SmartArt graphic, or text boxes.

The following sections describe these controls and drawing objects, and explain how to work
with these controls and objects in more detail.

6.2.3) Form Controls


Form controls are the original controls that are compatible with earlier versions of Excel,
starting with Excel version 5.0. Form controls are also designed for use on XLM macro sheets.
You use Form controls when you want to easily reference and interact with cell data without
using VBA code, and when you want to add controls to chart sheets. For example, after you
add a list box control to a worksheet and linking it to a cell, you can return a numeric value for
Data Analytics and Visualization 37
Dr. Chang Yun Fah

the current position of the selected item in the control. You can then use that numeric value in
conjunction with the INDEX function to select different items from the list.

You can also run macros by using Form controls. You can attach an existing macro to a control,
or write or record a new macro. When a user of the form clicks the control, the control runs the
macro.

However, these controls cannot be added to UserForms, used to control events, or modified to
run Web scripts on Web pages.

Summary of form controls


Button Example Description
Name
Label Identifies the purpose of a cell or text box, or
displays descriptive text (such as titles, captions,
pictures) or brief instructions.

Group Groups related controls into one visual unit in a


box rectangle with an optional label. Typically,
option buttons, check boxes, or closely related
contents are grouped.

Button Runs a macro that performs an action when a user


clicks it. A button is also referred to as a push
button.

Check Turns on or off a value that indicates an opposite


box and unambiguous choice. You can select more
than one check box on a worksheet or in a group
box. A check box can have one of three states:
selected (turned on), cleared (turned off), and
mixed, meaning a combination of on and off
states (as in a multiple selection).

Option Allows a single choice within a limited set of


button mutually exclusive choices; an option button is
usually contained in a group box or a frame. An
option button can have one of three states:
selected (turned on), cleared (turned off), and
mixed, meaning a combination of on and off
states (as in a multiple selection). An option
button is also referred to as a radio button.
Data Analytics and Visualization 38
Dr. Chang Yun Fah

Button Example Description


Name
List box Displays a list of one or more items of text from
which a user can choose. Use a list box for
displaying large numbers of choices that vary in
number or content. There are three types of list
boxes:
A single-selection list box enables only one
choice. In this case, a list box resembles a group
of option buttons, except that a list box can
handle a large number of items more efficiently.
A multiple-selection list box enables either one
choice or contiguous (adjacent) choices.
An extended-selection list box enables one
choice, contiguous choices, and noncontiguous
(or disjointed) choices.
Combo Combines a text box with a list box to create a
box drop-down list box. A combo box is more
compact than a list box but requires the user to
click the down arrow to display the list of items.
Use a combo box to enable a user to either type
an entry or choose only one item from the list.
The control displays the current value in the text
box, regardless of how that value is entered.

Scroll Scrolls through a range of values when you click


bar the scroll arrows or drag the scroll box. In
addition, you can move through a page (a preset
interval) of values by clicking the area between
the scroll box and either of the scroll arrows.
Typically, a user can also type a text value
directly into an associated cell or text box.
Spin Increases or decreases a value, such as a number
button increment, time, or date. To increase the value,
click the up arrow; to decrease the value, click the
down arrow. Typically, a user can also type a text
value directly into an associated cell or text box.

6.2.4) ActiveX Controls


ActiveX controls can be used on worksheet forms, with or without the use of VBA code, and
on VBA UserForms. In general, use ActiveX controls when you need more flexible design
requirements than those provided by Form controls. ActiveX controls have extensive properties
that you can use to customize their appearance, behavior, fonts, and other characteristics.

You can also control different events that occur when an ActiveX control is interacted with.
For example, you can perform different actions, depending on which choice a user selects from
Data Analytics and Visualization 39
Dr. Chang Yun Fah

a list box control, or you can query a database to refill a combo box with items when a user
clicks a button. You can also write macros that respond to events associated with ActiveX
controls. When a user of the form interacts with the control, your VBA code then runs to
process any events that occur for that control.

However, ActiveX controls cannot be added to chart sheets from the user interface or to XLM
macro sheets. You also cannot assign a macro to run directly from an ActiveX control the same
way you can from a Form control.

Summary of ActiveX controls


Button Example Description
Name
Check box Turns on or off a value that indicates an opposite
and unambiguous choice. You can select more than
one check box at a time on a worksheet or in a
group box. A check box can have one of three
states: selected (turned on), cleared (turned off),
and mixed, meaning a combination of on and off
states (as in a multiple selection).

Text box Enables you to, in a rectangular box, view, type, or


edit text or data that is bound to a cell. A text box
can also be a static text field that presents read-only
information.

Command Runs a macro that performs an action when a user


button clicks it. A command button is also referred to as a
push button.

Option Allows a single choice within a limited set of


button mutually exclusive choices usually contained in a
group box or frame. An option button can have one
of three states: selected (turned on), cleared (turned
off), and mixed, meaning a combination of on and
off states (as in a multiple selection). An option
button is also referred to as a radio button.
Data Analytics and Visualization 40
Dr. Chang Yun Fah

Button Example Description


Name
List box Displays a list of one or more items of text from
which a user can choose. Use a list box for
displaying large numbers of choices that vary in
number or content. There are three types of list
boxes:
A single-selection list box enables only one choice.
In this case, a list box resembles a group of option
buttons, except that a list box can handle a large
number of items more efficiently.
A multiple selection list box enables either one
choice or contiguous (adjacent) choices.
An extended-selection list box enables one choice,
contiguous choices, and noncontiguous (or
disjointed) choices.
Combo Combines a text box with a list box to create a drop-
box down list box. A combo box is more compact than
a list box, but requires the user to click the down
arrow to display the list of items. Use to allow a
user to either type an entry or choose only one item
from the list. The control displays the current value
in the text box, regardless of how that value is
entered.

Toggle Indicates a state, such as Yes/No, or a mode, such


button as On/Off. The button alternates between an
enabled and disabled state when it is clicked.

Spin Increases or decreases a value, such as a number


button increment, time, or date. To increase the value,
click the up arrow; to decrease the value, click the
down arrow. Typically, a user can also type a text
value into an associated cell or text box.

Scroll bar Scrolls through a range of values when you click


the scroll arrows or drag the scroll box. In addition,
you can move through a page (a preset interval) of
values by clicking the area between the scroll box
and either of the scroll arrows. Typically, a user can
also type a text value directly into an associated cell
or text box.
Data Analytics and Visualization 41
Dr. Chang Yun Fah

Button Example Description


Name
Label Identifies the purpose of a cell or text box, displays
descriptive text (such as titles, captions, pictures),
or provides brief instructions.

Image Embeds a picture, such as a bitmap, JPEG, or GIF.

Frame A rectangular object with an optional label that


control groups related controls into one visual unit.
Typically, option buttons, check boxes, or closely
related contents are grouped in a frame control.

More Displays a list of additional ActiveX controls


Controls available on your computer that you can add to a
custom form, such as Calendar Control 12.0 and
Windows Media Player. You can also register a
custom control in this dialog box.

We use the following example to explain how to use ActiveX Controls. Suppose that we have
5 scores listed in cells I2:I7 and the corresponding weights in cells J2:J7. We want to use
Command Button to perform the calculations on cells K2:K7 by multiplying score and weight,
and finally provides the answer on cell K8 by the summation of K2:K7.

The process are as follows:


1. Click on Developer tab
2. Select Insert tab
Data Analytics and Visualization 42
Dr. Chang Yun Fah

3. Choose one of the ActiveX Controls you want from Command Button, Combo Box,
Check Box, List Box, Text Box, Scroll Bar, Spin Button, Option Button, Label,
Image, and Toggle Button.
4. Drag the ActiveX Control you selected and put it on the Excel worksheet.
5. Click on the Properties to beautify the Active Control
6. Double click on the Active Control to get VBA.
7. Select the active worksheet on the left
8. Write your VBA codes, e.g. for Command Button

Private Sub CommandButton1_Click()


For i=2 to 7
Sheet1.Cells(i, “K”)=Sheet1.Cells(i, “I”)*Sheet1.Cells(i, “J”)
Sum = Sum + Sheet1.Cells(i, “K”)
Next i
Sheet1.Cells(8, “K”) = Sum
End Sub

9. Go to Excel worksheet and disable the Design Mode.


10. Click on the Active Control you created to execute the codes.

6.3) Building dashboard for visualization


Dashboards are often created on-the-fly with data being added simply because there is some
white space not being used. Different people in the company ask for different data to be
displayed and soon the dashboard becomes hard to read and full of meaningless non-related
information. When this happens, the dashboard is no longer useful.

6.3.1) Rules in building dashboard


This section discusses the steps that need to be taken during the design phase in order to create
a useful and actionable dashboard.

# Rule 1: Who are you trying to impress?


‘Does the CFO really need to know the servers are operating at 95% capacity?’

Think about the audience for the dashboard. The most effective dashboards target a single type
of user and just display data specific to that ‘use case’.

Is the dashboard going to be used by the executive team to monitor the company financials or
will it be used by the marketing team to monitor daily activities? It’s important to ensure that
where possible your dashboard consists of data that’s specific to a single audience. Often this
step is overlooked and dashboards include a mix of data: Some of which is relevant to one
audience and some to another.

# Rule 2: Select the right type of dashboard


There are 3 common types of dashboard, each performing a specific purpose. The types of
dashboard are:

Operational Dashboards These dashboards display data that facilitate the operational side
of a business. For example, in a business with a website, it’s important to ensure that your
website remains up and running, so you would monitor server up-time and utilisation. In a
Data Analytics and Visualization 43
Dr. Chang Yun Fah

business with an inside sales function, you may want to create a dedicated sales dashboard
that displays number of calls made and number of appointments booked. Think of an
operational dashboard as monitoring the nerve centre of your operation. Operational
dashboards often require real-time or near real-time data.

Strategic / Executive Dashboards Strategic dashboards will typically provide the KPIs
(Key Performance Indicators) that a company executive team track on a periodic (daily,
weekly or monthly basis). A strategic dashboard should provide the executive team with a
high-level overview of the state of the business together with the opportunities the business
faces. This data could be:
 Periodic revenue (vs prior period)
 Costs (vs prior period)
 Headcount (by department)
 Sales pipeline

Analytical Dashboards An analytical dashboard could display operational or strategic data.


However, this type of dashboard will offer drill-down functionality - allowing the user to
explore more of the data and get different insights. Often dashboards include this
functionality when it is not required. Do not simply provide this functionality because you
can.

Bear in mind that different user groups may require a different type of dashboard. The
marketing manager may need both a Strategic and Operational view of their data. Where
possible create two separate dashboards.

# Rule 3: Group data logically – use space wisely


A well-designed dashboard will ensure that data is displayed in logical groups. For example, if
a dashboard includes Financial KPIs and Sales Pipeline, ensure that the financial data is
displayed next to each other, with the Sales Pipeline data displayed together in a separate
logical group.

Grouping is often by department or functional area and can include:


 Product (Inventory, development)
 Sales/Marketing
 Finance (Actuals and forecasts)
 People

Often the most important real-estate on a dashboard (top left-hand corner) is reserved for a
company logo or a navigation tool. This is not good dashboard practice as the part of the screen
is the most important part of your dashboard (this is because most western languages read from
top to bottom and from left to right - hence our eye will start it’s journey when discovering
something new at the top left-hand corner.

# Rule 4: Make the data relevant to the audience


An Executive dashboard can have a number of different audiences. Ensure that the data you
display is relevant to the users. Think about the scope and reach of your data:
 The whole company
 By Department
 Individuals
 Suppliers
Data Analytics and Visualization 44
Dr. Chang Yun Fah

Ensure that you understand exactly who the intended audience is and the scope of their
requirements. In a small organization, the Executive dashboard is likely to include KPI data
across all departments. However, in a larger company, each department may have their own
Executive dashboard.

Gaining agreement on dashboard components from non-related parties is doomed to fail.

# Rule 5: Don’t clutter your dashboard – present the most important metrics only
Dashboards are often cluttered. Cluttered displays deflect the focus from the important
messages. Some are cluttered with useful and relevant information and some are cluttered with
useless and irrelevant information. Neither of these situations are desirable.

Each dashboard type may require different amounts of data (for example an Executive
dashboard may only need 6 numbers, whereas an Operational dashboard may need upwards of
20) There is no hard and fast rule to follow here, except ensuring that everything you display
is relevant and meaningful to the audience. Do not add a graph or text simply because you can.

# Rule 6: How often does the data really need to be refreshed?


Ensuring that your dashboard data is being refreshed at the right intervals saves time during
development (why go through the pain of sourcing real-time data, when all you need is a
weekly feed) and can ensure optimal performance once the dashboard is live.

Examples of refresh rates on dashboards include:


 Real-time (or near real-time)
 Daily, weekly, monthly

As a rule of thumb, operational dashboards require data in real-time or near real-time, whereas
executive/strategic dashboards require data refreshed on a less frequent basis.
Data Analytics and Visualization 45
Dr. Chang Yun Fah

6.3.2) Make your dashboard clean and simple


A well-designed dashboard should focus on the message that the dashboard is trying to convey.
Any component or visualization that is not directly contributing to the message should be
removed. This includes:

a) Logos - In some instances logo’s are required, but does the Operations Manager really
need to be reminded of the company he is working for?
b) Navigation - If you need to include navigation options on your dashboard, have you
really designed the dashboard correctly?
c) Non-essential text - Keep labelling and instructions to an absolute minimum
d) Too much color - Use subtle shades of the same color when presenting multiple data
series. Don’t force the user to wear sun-glasses to read your dashboard!
e) 3-Dimensional objects - We’ve never seen a dashboard where 3-D enhances the
message. Avoid at all cost.
f) Horizontal or vertical guide lines - In some instances guide lines are useful, but
overusing them detracts from the data
g) Too much detail - Displaying revenue in the format $1,254,345.67 to the CEO – surely
he simply wants to see $1.25m?

6.3.3) Build dashboard with Slicers


In this section, we will build our own dashboard using Slicers in MS Excel. Our audience is
interested to obtain the information as below:
a) The total costs, revenue, and profit per year.
b) Quantity purchased and profit by gender, country and product category.
c) Profit from the top 5 age levels.
Data Analytics and Visualization 46
Dr. Chang Yun Fah

d) Show quarterly profit over the years using line chart.


e) Relationship between cost and profit.

The following steps help you to build your own dashboard that provide the above information.
1) Open the Excel file: Spot_Sale_Visualization.
2) Ensure that the file is in table format

3) From the Insert tab, select PivotTable tab to obtain the following dialog box. Enter the
table or data range and put the pivot table in a new worksheet.
4) Chang the new worksheet name to “PivotTable”.

5) Select Cost, Revenue and Profit fields on the left-hand panel with the summation
function and arrange them in rows. Select Year as well to view the Cost, Revenue and
Profit at different years.
6) Right click on the cost, revenue and profit to change the figure to a format you like.
Data Analytics and Visualization 47
Dr. Chang Yun Fah

7) To answer the second question, we select PivotTable tab again with the same data range.
But this time, we place the pivot table in the existing worksheet “PivotTable” starting
from cell A11.
8) Place the Customer Gender in the rows field. Place the Order Quantity and Profit in the
function field. Place Year in the filter box.
9) Repeat steps 7 and 8 for Country and Product Category.
Data Analytics and Visualization 48
Dr. Chang Yun Fah

10) Repeat the same steps by placing the Customer Age in the rows field and Profit in the
function field.
11) At one of the age value, right click the mouse and select Filter from the panel. Choose
Top 10 Filter from the list. In the Top 10 Filter, change the value 10 to 5.
12) Repeat step 11 by choosing Sort from the panel. Arrange the values from largest to
smallest.

13) Create the pivot table for profit over dates in the rows field. At one of the cells, right
click and select Group from the panel.
14) Enter the starting date and ending date for your data. Select the grouping by Quarters
and Years from the dialog box.
Data Analytics and Visualization 49
Dr. Chang Yun Fah

After preparing the pivot tables, we will continue to create the pivot charts. The following are
the steps.

15) Go to Gender’s pivot table, then click on the Analyze tab, follow by PivotChart.
16) Select the type of chart you want to plot the data. In this example, we choose clustered
column chart.
17) Design your chart with different colours and features.
Data Analytics and Visualization 50
Dr. Chang Yun Fah

18) Right click on the chart and select Move Chart to move your chart to Dashboard
worksheet.
19) Repeats step 18 to move all charts to Dashboard.

20) Create scatter plot for Cost versus Profit using Insert tab and Charts tab.
21) Create Profit, Revenue and Cost indices using function GETPIVOTDATA as follow.
Data Analytics and Visualization 51
Dr. Chang Yun Fah

22) Right click one of the slicers to get the panel. Select Report Connections.
23) Check all the pivot tables that appeared in the dialog box. This will link the selected
pivot table with other pivot tables.
24) Repeat step 23 for other pivot tables.
25) Finally, rearrange the charts and design your dashboard.

Das könnte Ihnen auch gefallen