Book Image

Mastering Data Visualization with Microsoft Visio Professional 2016

By : John Marshall, David Parker
Book Image

Mastering Data Visualization with Microsoft Visio Professional 2016

By: John Marshall, David Parker

Overview of this book

Microsoft Visio Professional is a data visualization application that is used by many different market sectors and many different departments to represent information visually, from network infrastructure to organization charts, from process diagrams to office layouts. Starting off with a brief introduction to Visio Professional 2016 and then moving on to data storage, linking data to shapes, and working with SQL Server to create a solid foundation. Then we’ll cover topics such as refreshing data, working with geographical data, working with various graphics, and diagrams, and more. Finally, you’ll find out how to deploy custom stencils, templates, and code.
Table of Contents (17 chapters)
Mastering Data Visualization with Microsoft Visio Professional 2016
Credits
About the Author
www.PacktPub.com
Preface
Index

Connecting shapes from data


The example Personnel DataRecordset has a Reports To column that is used by Organization Chart Wizard to create a hierarchy by connecting the shapes together. The data that connects two shapes together does not need to be in the same DataRecordset, especially if there are many-to-many relationships.

A lot of the VBA code in this chapter make increasing use of arrays. However, the VBA IsArray() and IsEmpty() functions do not really report an empty array. Therefore, the following function, IsEmptyArray(), will return True or False by forcing an error if necessary:

Also, much of the code herein needs to get the index of DataColumn. However, the DataColumn object does not have an index property. Therefore, the following function, GetColumnIndex(), returns the index or -1 if the specified column name does not exist in DataRecordset:

Now that the helper functions are defined, they can be used in the sub-function LinkShapes() to iterate through the shapes on the active...