Visio Data Graphics: Easy text and data entry for custom shapes

Sep 16

Like it or not, Visio has for some time been the de facto wireframing tool in Windows. At Design For Use, we have been steadily dialing-up the sophistication of our wireframes using some of the powerful yet difficult to discover features of this tool. In this tutorial, we describe the steps to create custom, reusable shapes (data graphics) that accept user inputs (text, data) through a dialog box. This tutorial and the associated screenshots are for Visio 2007 but we can apply the same principles for other versions of Visio.


Oftentimes, we create a stencil that represents a generic module and includes things like a header, sub-head, body text. Traditionally, working with this type of stencil has been a cumbersome and inefficient effort requiring our team to drag-and-drop from the document stencil and then select and edit individual text elements (sometimes nested in groups of groups). No longer…

Below are two examples.

Example 1: A content-based module

example 1: a content-based module

Example 2: A mock site map with page labels and IDs

example 2: a mock site map with page labels and IDs


Step 1:

Using the rectangle tool from the toolbar (ctrl+8), draw a rectangle as shown below and fill it with gray (figure 1).

Figure 1: 2x1 inches rectangle

figure 1: 2×1 inches rectangle

Step 2:

Right-Click on the rectangle shape and select Data > ‘Shape Data’ from the menu (figure 2). Then select ‘Yes’ when prompted to define the shape data now.

figure 2: Shape Data menu

Step 3:

The ‘Define Shape Data’ dialog is now displayed as figure 3. ‘Labels’ will be displayed on the shape while ‘Type’ will allow you to choose between a free form text or a drop list. For simplicity, ignore the rest of the fields, though with a little trial and error they are quite straightforward to use. Now, define labels and types for three fields by repeatedly clicking on the ‘New’ button. You should see three fields defined as shown in figure 4.

figure 3: define shape data dialog

figure 4: shape data dialog after the fields are defined

figure 4: shape data dialog after the fields are defined

Step 4:

Upon pressing ‘OK’ to close the ‘Define Shape Data’ dialog, you will be prompted to enter values for each of the three fields. Enter the values as shown in figure 5 or leave them blank for now. Click ‘OK’ to close the prompt. Don’t worry if these value are not visible on your shape yet.

figure 5: enter shape data dialog

Step 5:

Again, right-click on the rectangle shape and this time select Data > ‘Edit Data Graphic’ from the menu (figure 6). A data graphic dialog as shown in figure 7 will be displayed. Click on the ‘New Item’ pull down and select ‘Text…’ from the options.

figure 6: right-click menu

Figure 2: Shape Data menu

figure 7: data graphic dialog

Step 6:

The ‘New Text’ dialog (figure 8) will allow you enter the values for the fields defined above. Enter the values in the dialog as show in figure 9. The ‘Callout Position’ options can be changed later by moving the text block manually, so just make sure your fields don’t overlap for now. You can also experiment with other options to gain a better control on how the fields are displayed later. Select ‘OK’ to close the dialog.

Figure 3

figure 8: new text dialog

figure 9: new text dialog after values are entered

Step 7:

The Data Graphic dialog should now look like figure 10. Add the remaining two fields in the similar manner to mirror the values displayed in figure 11.

figure 10: data graphic entry

figure 11: all entries in the data graphic dialog

Step 8:

Once you close the Data Graphic dialog, your shape should look like Figure 12. You can now select each text block individually to re-position and re-format to look like figure 13. All text blocks are now grouped with the rectangle shape, so double click to select each text block. (Note: In this example, Calibri 12 pt. font has been used.)

figure 12: rectangle shape with text fields in default positions

figure 13: reformatted rectangle shape

Step 9:

You are almost there. Now, the prompt to enter the field values through a dialog needs to be turned on. First, select the grouped rectangle shape by clicking on it, then choose Window > ‘Show ShapeSheet’ from Visio’s main menu (figure 14). In the ShapeSheet of the drawing, scroll down to the table displaying ‘Shape Data’ (figure 15). If you don’t see the Shape Data table, then you probably forgot to select the rectangle shape first.

figure 14: selecting ‘Show ShapeSheet’ from Visio’s ‘Window’ menu

figure 15: ShapeSheet window of the selected rectangle shape

Step 10:

Finally, change all the field values under ‘Ask’ column to TRUE (figure 16). Make sure to hit Enter each time to register the change.

figure 16: ShapeData table in the ShapeSheet

figure 16: ShapeData table in the ShapeSheet

That’s it. You are done. Now every time you copy and paste this shape, you will see a dialog (figure 17) to input the field values.

figure 17: dialog to input field

Or you can drag this shape into the document stencil to use it across a wireframe deck as a Master. Visio provides masters — any group of text and shapes — as a convenient, reusable way to add elements to our wireframes. In particular, masters that are part of the document stencil can be modified with changes cascading to any instances of that master throughout the entire document. Microsoft Online has a nice introduction on creating masters in the document stencil.

Posted by: Administrator
  1. Gaurav

    Mar 3, 2010 - 05:45 AM

    How do you fair visio against omnigraffle ?

    1. drichard

      Mar 3, 2010 - 11:23 AM

      Guarav –
      Our team is working on PCs so we (unfortunately) aren’t familiar with how Visio compares to Omnigraffle. The folks who use OG are very fervent about it as a wireframing tool. Not sure to what extent it can be used in the programmatic way that we use Visio. There is a very lively discussion about wireframing tools on one of the UX groups on LinkedIn. Best of luck!

  1. Molly

    Jun 6, 2010 - 11:56 AM

    This is great, thanks for sharing!

  1. Joshua Lewis

    Jul 7, 2010 - 09:35 AM

    This is great, thanks. How can you change the double click event to show the same data entry prompt?

Leave a Comment