Data Graphics: visualizing data on your diagram

Last week I talked about connecting a Visio diagram to data, but we hadn't gone over how to actually display the data on the diagram itself. That's where data graphics comes in. Data graphics is a new technology we are introducing in Visio 12 that provides a variety of ways of showing data on top of shapes. It's really the key to all of the different things we are doing with data in Visio 12. Let's look at a few quick examples of shapes with data graphics applied to them:

Data graphics can be as simple as those next to the computer shape on the left, which are just 3 text fields and their labels, or they can include more graphical elements, such as the bars in the middle example or the stoplight icons on the rightmost shape. Here's the list of different types of data graphics items that will be available with Visio 12. I'm only showing a couple examples of each -- Visio will come with more (and you can of course create your own as well):

Text A variety of different ways to show text on or around a shape.

Data Bars Databound widgets that change size according to data.

Icon Sets Different icons that show or hide on a shape based on data.

Color by Value Change the color of the Visio shape based on data.

Data graphics consist of a combination of these different items, connected to specific fields of data and laid out around a Visio shape in a specific way. Once a data graphic is applied to a shape, it acts like part of the shape. The data graphic will move with the shape, be copied with the shape, and be deleted with the shape.

So how do you use data graphics? First you need to have some shapes in your diagram with data behind them. This can be simply shape data that you typed in for a shape, or it could be data that was imported using the Data Link feature. The good news is that if you are using Data Link, we'll automatically create and apply a simple data graphic to the shapes when you connect them to data. If you want to edit the data graphic, or apply your own combination of data graphic items to a shape, you use the Data Graphics task pane:

This is the central place to go to in order to see all of the different data graphics that are applied in your diagram, apply them to other shapes, or create and edit them. To apply a data graphic to a shape, simply select the shape and click on one of the data graphic previews in the task pane. If you want to edit a data graphic, right click on it and choose edit. This opens the Edit Data Graphic dialog:

This dialog is where you can customize your data graphics or build up a new one from scratch using the different types of data graphic items (text, data bars, icon sets, color by value). If you want to add an element, simple click on the "New item" button. This shows a dropdown allowing you to choose one of the different types:

When you add an item, you get a detailed settings dialog that allows you to specify things such as the data field the item is bound to and its label. You can also control the item's position here as well. By default, Visio will automatically group all of the data graphics together into a single location around the shape, but if you choose, you could move each different data graphic item to a different position around the shape.

One thing you need to consider is where to place the data graphic. Is it going to go inside of the actual shape, or outside (usually to the right or underneath)? If it goes inside, it may compete with the text that you have typed into the shape (in the workflow diagram from last week, that text contained the names of the steps in the workflow). To overcome this, Visio allows you to turn off the shape's text box when using a data graphic if desired. This is particularly useful if that same information is also contained in a data field and can just become part of the data graphic. 

So now let's return to the workflow shapes and see what it would take to create their data graphics. All of the editing actions you need to take to accomplish this are in the Edit Data Graphics dialog. Here's what the shape looked like to start with:

First, we need to turn the shape text off, and add a text data graphic item at the top of the shape that is linked to the name field of the data:

Next a couple more text items are added, linked to the status field and the number of the step in the workflow process:

And a data bar is added to visually show the average time in days that each step in the process takes:

We also want to call out when a step is taking too long to complete. So we will also show an icon when the average time is above a certain threshold (in this case, if takes longer than 10 days, we'll show a red icon, and if it's between 5 and 10 days we'll show a yellow icon).

Finally, I added some additional formatting with our new themes feature (more on that in future posts) to arrive at the final result:

Now that this data graphic is applied to the shape, when the underlying data about the workflow process changes, the diagram can be updated and the graphics will automatically adjust to show the changes. This allows you to use the diagram as a visual report for the workflow data.

I hope this has given you some ideas about how you could use Data Link and Data Graphics in diagrams that you work with. Feel free to drop me a line if you come up with any -- I'd love to hear about them. I'm taking a break for the holidays after this post -- I'll see you next year!