Chapter 10. Creating and Formatting Graphics

Using the Shapes Tools

Creating WordArt

Creating SmartArt

Inserting Other Graphics

Formatting Graphics

Working with Graphic Objects

More Tricks with Graphic Objects

MICROSOFT Excel 2010 gives you the tools to create a variety of graphic objects—boxes, lines, circles, ovals, arcs, freeform polygons, text boxes, buttons, and a wide assortment of complex predefined shapes, clip art, and SmartArt graphics. If you already have graphics created in other programs, Excel 2010 imports those graphics as well. Throughout this chapter, you’ll learn how to add graphics to worksheets, but you can use many of the same kinds of effects also when you’re creating charts. First we discuss creating and inserting various kinds of graphic objects, and then we cover formatting and working with them.

Most of your adventures with graphics begin by using the buttons and menus found on the Insert tab on the ribbon, shown in Figure 10-1.

Note

For more information about charts, see Part 6, Part 6.

The Insert tab contains most of the drawing tools.

Figure 10-1. The Insert tab contains most of the drawing tools.

Users of Excel 2007 will notice a few new tools on the Insert tab in Excel 2010, namely Screenshot in the Illustrations group, and three new groups: Sparklines, Filter, and Symbols. Sparklines are tiny charts that fit into cells and are discussed in Chapter 20. The Slicer tool in the Filter group is a new PivotTable tool, discussed in Chapter 23 We cover the Screenshot tool on page 431 and the Symbol tool on page 156.

image with no caption

The Excel graphics tool chest contains many of the powerful capabilities of dedicated illustration programs. Using only the tools in the Shapes gallery on the ribbon, you can create lines, rectangles, and ovals; smooth and freeform curves; linked objects using connectors; basic and not-so-basic shapes, such as pentagons and lightning bolts; a variety of straight, curved, three-dimensional (3-D), and multiheaded arrows; stars, emblems, and banners; and even a variety of callouts. Click the Shapes button to display the gallery shown in Figure 10-2.

If you have ever used a drawing program, such as Paint or Adobe Illustrator, you already know how to create lines, arrows, ovals, and rectangles. In Excel, as in graphics programs, click the tool you want, and then drag the pointer to create the object. When you drag a simple box shape using the Rectangle tool, for example, Excel displays Rectangle 1 in the Name box at the left end of the formula bar. Excel refers to new graphic objects by category and numbers them in the order in which you create them.

Objects you create appear to float over the worksheet or chart in a separate layer. Objects are separate from the worksheet or chart, and you can group and format them as discrete items. Here are a few more important facts you should know about using the drawing tools:

The word constrain has a somewhat negative connotation, but in computer lingo, a constraint is usually a good thing. If you apply a constraint to an object you draw, for example, you force the object to adhere to a specific angle or proportion. Using constraints is the easiest way to create perfect circles and squares. For example, you can hold down Shift (and sometimes Ctrl) while creating objects to constrain them, as Figure 10-4 illustrates.

The key you use to constrain your object depends on the type of constraint you want to cause. The following lists describe the types of constraints created using each method.

Holding down the Shift key causes the following constraints:

Holding down the Ctrl key causes the following constraints:

Holding down the Alt key causes the following constraint:

Tip

INSIDE OUT Selecting Objects

When you work with objects, it’s almost as if another program with a transparent desktop is floating over the worksheet—as if the objects you draw are in another dimension. In a sense, they are. What goes on in the grid of Excel has little to do with what goes on in the drawing layer, although you do have opportunities to create interaction between objects and worksheets using macros and formulas.

When you are working in cells, you can click any graphic object to select it and then click the worksheet to select cells. You can hop back and forth between the object and worksheet, no problem. But they are still parallel universes, which becomes apparent when you try to select multiple items. For example, you can drag to select a range of cells, but you cannot drag a selection rectangle around a group of objects to select them; instead, you end up selecting a cell in that “other dimension” as soon as you click. You can press Ctrl and click to add nonadjacent cells to a selection on the worksheet, and this method works similarly with objects. In fact, you can select an object, then hold down either Shift or Ctrl, and click additional objects to add them to the selection—either method accomplishes the same result. You can also press Ctrl+A to “select all” in either the worksheet or the object layer. If you do so with a cell selected, all cells are selected; if you do so with an object selected, all objects are selected. But you can’t select cells and objects together, which you might want to do when you’re copying a portion of a worksheet to another location and want to copy adjacent objects as well. You can actually accomplish this by selecting the underlying cells and pasting them in the new location. The objects may not be selected, but they are usually linked to a cell location. Unless you specify otherwise, objects travel with their underlying cells if you move or copy them. For more information, see Positioning Objects on page 423.

The tools in the Shapes gallery are extremely easy to use. Just click a tool, and then click and drag to create the object on the worksheet. A few tools would benefit from a little additional information, however, and we’ll discuss them in the following list:

The Freeform and Curve tools are different from the others in that when you release the mouse button, you’re not done drawing. To finish drawing using either of these tools, you must click the starting point to close the loop and create a solid object or double-click where you want the line to end to create a line. Figure 10-5 shows a few objects created using these tools.

For example, if you click the Freeform tool and then click anywhere on the worksheet or chart to begin drawing, the line remains anchored to the point you clicked. If you release the mouse button, the line remains “attached,” stretching from the anchor point to the crosshairs pointer like a rubber band. If you stretch the line and click again, you create a segment that is anchored between the first and second point. You can continue this as long as you want, creating additional segments with each new anchor point. If you drag, you create a curved freehand line. By combining these methods, you can create a hybrid object with both straight and curved lines. If you click the beginning of the line, you create a solid object, or you can double-click at any time to finish drawing.

When you edit the points for an object you created using the Scribble, Curve, or Freeform tool, you can fine-tune the curves even further by using commands on the shortcut menu that appears when you right-click any edit point, as shown in Figure 10-7.

If you click any edit point, vertex handles become visible that you can drag to modify the curve or angle at that vertex, as shown in Figure 10-8. These handles give you total control over the shape of a curve. The longer the vertex handle, the flatter the curve in the direction you drag.

Excel 2010 offers three types of points. You can right-click any existing point and change it to a different type of point by using the corresponding command on the shortcut menu:

image with no caption

Use the Text Box button in the Text group on the Insert tab to add notes, headings, legends, and other text to your worksheets and charts to give more impact or to clarify the data you’re presenting.

Click the Text Box button, point to a location on your worksheet, and drag to create a box. A blinking cursor appears in the box, indicating that you can begin typing. After you finish, you can select and format text using the same commands you use for text in cells. When you select a text box, drag any of its eight perimeter handles to resize it.

The Shapes gallery on the Insert tab offers dozens of predrawn shapes you can use to add effective visual communication to your worksheets. Most shapes display a yellow, diamond-shaped handle somewhere on the perimeter. If you drag this handle, you can control a specific dimension of the shape, as Figure 10-10 illustrates.

In addition to the diamond handle, all two-dimensional objects in Excel display a panhandle that you drag to rotate the object, as shown in Figure 10-11.

Most shapes are easy to use and somewhat self-explanatory. Connectors and callouts, however, have some special qualities that bear mentioning. If you’ve ever spent time creating drawings using simple lines and boxes, you know what a problem it can be when you need to reposition any of the objects. You usually end up spending as much time fine-tuning the drawing as you spent drawing it in the first place. Connectors, which are special kinds of lines that are “sticky” on both ends, can help. You use them when you want to connect shapes with lines that remain attached and stretch, making it easier to reposition objects later with a minimum of tweaking.

The connector tools are the six tools located in the middle of the Lines group in the Shapes gallery, as shown in Figure 10-12. After you click one of these tools, special points appear when you rest the pointer on any existing shape. These are connection points, and if you click one of them, the connector line attaches to that point. The second click attaches the other end of the connector line to a point on another object and completes the connector line.

As Figure 10-13 shows, the resulting connector line stays attached to the two points even when you move the shapes. You don’t have to attach connectors to anything. For example, you can connect one end to a shape and leave the other end free to create your own custom callout.

Connectors are particularly useful for creating flow charts. First, sketch your ideas using connectors with the Flowchart tools in the Shapes gallery. You can move flow charts as you work, and the connector lines reroute themselves as necessary.

Callouts are special text boxes with connector lines already attached. You can use them to add labels to important information or to describe important items. The most familiar type of callout is the kind you see in comics. Excel includes several of these balloon callouts, shown in Figure 10-14, with additional text formatting applied. Note that in this type of callout, the tip of the balloon pointer is the sticky point.

After drawing a callout, you can immediately begin typing the text you want in the callout. Then drag the diamond-shaped handle to move the tip of the callout indicator to the location you want.