**Visual Detection of Change Points and Trends Using Animated Bubble Charts**

Sackmone Sirisack and Anders Grimvall *Linköping University, Sweden* 

#### **1. Introduction**

326 Environmental Monitoring

Starodub N., Rebrijev A., Maslyuk A. (2002b) *Photopolymerisable materils and enzymatic* 

Starodub N. F., Rebriev A. V. (2002) *Biosensors for diagnostics of some diseases*. Abstract Book

Starodub N.F., Starodub V. M. (2002) Biosensor control of water contamination by some chemical organic substances. *Chemistry and Technology of Water*, 6, 112-119. Starodub N.F., Pyrogova L.V., Demchenko A., Nabok A.V. (2005) Antibody immobilization

Starodub N.F. (2006) Biosensor for the evaluation of lipase. J. Mol. Catalysis B: Enzymatic,

Starodub N.F., Rebriev A.V. (2007) Liquid photopolymerizable compositions as immobilized

Starodub N.F., Kanjuk M.I., Shmyryeva A.N. (2008) Microelectronic multi-parametrical

Turner A. P. F. Preface (1989) *Biosensors: Fundamentals and Applications.* Oxford: Oxford Univ.

Wan K., Chovelon J.M., Jaffrezic-Renault N., Soldatkin A.P. (1999*)* Sensitive detection of

Wróblewski W., Dawgul M., Torbicz W., Brzózka Z. (1997) Anion-selective CHEMFETs*.* 

pesticide using Enfet with enzymes immobilized by cross-linking and entrapment

August 2002.

40, 155-160.

Press. p. 3–12.

*Proc. SPIE.* 3054. 197.

Germany, 15-20 September 2002.

receptors, *Bioelectrochemistry,* 66, 111-115.

biosensors. *Biotechnology,* 1, 1, 61-73. Triven M. (1983) *Immobilization enzymes.* Mir, M.

matrix of biosensors. *Bioelectrochemistry,* 71, 1, 29-32.

method*. Sensors and Actuators (B).* 58. 399-408.

Wudvord J. (1988) *Immobilized cells and enzymes*. Methods. Mir, M.

*biosensors*. Abstract Book of NATO advanced research workshop "Nanostructured materials and coatings for biomedical and sensor applications". Kiev, Ukraine, 4-8

of 53rd Annual Meting of the International Society of Electrochemistry "Electrochemistry in Molecular and Microscopic Dimensions". Dusseldorf,

on the metal and silicon surface. The use of self-assambled layers and specific

The rapid growth of automatic data collection systems has increased the need for algorithms that can efficiently reveal important features of large or complex datasets. For example, it is often of great interest to examine the occurrence of abrupt changes in long bi- or multivariate time series of data. Several numerical algorithms and statistical tests have been developed to detect abrupt shifts in the mean or other parameters of uni- or multivariate distributions (Caussinus & Mestre, 2004; Hawkins, 1977, 2001; Srivastava & Worsley, 1986; Stephens, 1994). However, there is also a need for visualization techniques that can help the user identify any type of abrupt changes or trends in the collected data. More generally, techniques are needed that can simultaneously highlight important features of the data and filter out irrelevant information (Bederson & Boltman, 1999; Bundesen, 1990; Cleveland & McGill, 1984; Healey, 2000; Ware, 2004). In this chapter, we present flexible and user-friendly animations of bubble charts in which subsets of the collected data are sequentially highlighted on a static background representing all data points.

The basic ideas of interactive visualization of quantitative data were presented before computer technologies were sufficiently developed to enable widespread use of such methods. In 1978, Newton introduced a form of linked brushing that allowed the user to select a subset of observations in one display and simultaneously highlight the same subset in another display. About a decade later, several ground-breaking articles were published. Asimov (1985) introduced the concept of helicopter tours for viewing highdimensional datasets via a structured progression of 2D projections, and Becker and coworkers (1987a, b) provided a systematic framework for brushing, linking, and other forms of interactive statistical graphics. Moreover, Unwin and colleagues (1988) demonstrated how zooming, rescaling, and overlaying can facilitate visual analysis of multivariate time series data.

More recently, improvements in computing power, display resolution, and numerical algorithms have brought interactive visualization of quantitative data to higher levels and stimulated the development of new applications. The software XGobi and its descendant GGobi set a new standard for interactive modification of linked plotting windows, and an application programming interface made such methods available to the rapidly growing group of R users (Cook & Swayne, 2007; Swayne et al., 2003; the GGobi website, 2011). Zooming and rescaling were established as standard tools in software packages for time

Visual Detection of Change Points and Trends Using Animated Bubble Charts 329

In Excel® and other spreadsheet programs, graphs added to a worksheet can be updated automatically and almost instantaneously when the content of the worksheet is altered. This enables animations driven by a macro that achieves step-by-step changes in the content of a range of worksheet cells. The speed of an animation can be controlled by making calls to a special function that puts the macro to sleep and wakes it up after a specified amount of

Because visual inspection is particularly suitable for detecting motion against a static background, we developed animations in which all data are used to construct a static background, and different subsets of data are sequentially highlighted. In a 2D bubble chart, this type of displays can be constructed by using open markers for the static background and filled markers for the highlighted data. This is illustrated in Figure 1, which shows how the interdependence between reported pH and alkalinity levels in the Baltic Proper has changed over time. In particular, it can be noted that the reported interdependence changed dramatically from 1989–1993 to 1994–1998, most probably due to changes in laboratory

A user-friendly implementation of animated bubble charts requires a good balance between flexibility and standardization. The selection of data and the design of the bubble charts should be flexible, whereas efficient updating of spreadsheets and graphs is greatly facilitated if the data tables have a standardized design. This favours two-stage procedures in which a set of user forms first help the user organize the data in a standardized manner and create a suitable graph template; thereafter, the animation can be run and controlled

We created a VBA macro that initially determines the position and size of the data tables that are to be visualized, and then utilizes list boxes to select up to five variables for an animated bubble chart. The first variable, which is required and may represent a time stamp, is used to control the highlighting of different subsets of data. Variables two and three, which are also required, represent the *x* and *y* variables in a bubble chart. Variable four, which is optional, can be used to partition the set of bubbles into different groups.

The macro that prepares for the animation can also allow the user to select a suitable step length (time step) for the animation and a desired range of animation records (time span). Furthermore, the preparations include automatic scaling of the *x*- and *y*-axes of the bubble chart and selection of marker types. The applicability of animated bubble charts can be further increased by performing an optional standardization of the *x* and *y* variables to mean zero and variance one, and by calculating the first two principal components of a userdefined set of variables. In the latter case, high-dimensional data can be scrutinized by

The simplest form of bubble charts has a single group of highlighted cases (see Fig. 1). This type of display can easily be generalized to displays in which two or more groups are

Finally, another optional variable can be used to size code the bubbles.

**2. General principles of animating bubble charts** 

time.

practices.

**3. Some design issues** 

with buttons and scroll bars.

creating animated 2D score charts.

**4. Different types of displays** 

**4.1 Standard bubble charts with groups** 

series analysis, and visual specification of queries was introduced to facilitate the search for interesting features of time series data (Hochheiser et al., 2003).

Motion charts, or animated bubble charts, represent another breakthrough in data visualization (the Gapminder website, 2011). The basic display is a 2D bubble chart showing observed pairs of two variables *x* and *y* that have been recorded annually for a set of objects. By highlighting the positions of the bubbles year by year, changes over time can be visualized. Additional information about the investigated objects can be entered into the graphs by colour-coding the bubbles and letting their size vary with some covariate. A Google gadget (the Google website, 2011) has made motion charts available to any user with a good Internet connection.

The use of animated population pyramids in official statistics (the Australian Bureau of Statistics, 2011) illustrates that almost any static graph in statistics can be animated to visualize changes over time. However, some authors have emphasized that animations are not always superior to static presentations such as a small multiples display (Robertson et al., 2008). Visualization of temporal changes in the size and shape of 2D point clouds represents yet another approach that is particularly suitable for exploring large datasets (Landesberger et al., 2009).

Here, we present a flexible two-stage method for making animated bubble charts in Excel®. In the first stage, a macro written in VBA (Visual Basic for Applications) is utilized to identify data tables in a given worksheet and help the user select and organize the inputs to the animation. This macro also creates a suitable bubble-chart template. Thereafter, a collection of other VBA macros is employed to produce the animation.

The methods and software solutions we propose are designed to handle fairly large datasets with multiple groups of objects and multiple observations per time stamp and group. Furthermore, it can be noted that the order in which different subsets of data are highlighted can be determined by an arbitrary numerical or string variable. In general, bubble charts are used to visualize relationships between interval variables. However, relationships involving categorical or ordinal variables can also be visualized. In such cases, adding a small amount of noise (jitter) to the original data might be helpful, because it will improve the separation of the data points so that each point is made visible. In addition, the visualization can be extended to high-dimensional time series data by using a macro that first performs principal components analysis and then creates 2D animated score charts.

After a brief summary of the general principles of animating bubble charts, and some remarks regarding design issues, we use time series of daily to monthly environmental data to illustrate the power of visual tools to bring out important characteristics of the collected data. Most of our analyses are focused on the occurrence of sudden shifts in the mean or dispersion, and whether or not such shifts can be found in all investigated groups of data. However, the tools presented here are also used to examine temporal trends across seasons and changes along gradients. Moreover, we use a set of multivariate chemical data on olive oils to illustrate how animated score charts can highlight differences between geographical regions.

After presenting a set of useful displays and animation options, we resume our discussion of factors that influence the visual impression of static and animated charts, and we also consider how to achieve a good balance between the information content of a display and perceptual capacity limits. In addition, we address some technical aspects of using spreadsheets with tens of thousands of observations.
