## Creating graphs

Graphs let you communicate statistical information in a visual way. In Adobe Illustrator, you can create nine different types of graphs and customize them to suit your needs. Click and hold the graph tool in the Tools panel to see all different types of graphs you can create.

### Create a graph

Select a graph tool.

The tool you use initially determines the type of graph Illustrator generates; however, you can easily change the type of graph later on.

Define the dimensions of the graph in any of the following ways:

Drag diagonally from the corner where you want the graph to begin to the opposite corner. Alt‑drag (Windows) or Option‑drag (Mac OS) to draw the graph from its center. Hold down Shift to constrain the graph to a square.

Click where you want to create the graph. Enter a width and height for the graph, and click OK.

Note: The dimensions you define are for the main body of the graph and do not encompass the graph’s labels and legend.

Enter data for the graph in the Graph Data window.

Important: Graph data must be arranged in a specific order, which varies by graph type. Before you start to enter data, be sure to read about how to organize labels and data sets in the worksheet.Click the Apply button , or press the Enter key on the numeric keypad to create the graph.

The Graph Data window stays open until you close it. This allows you to easily switch between editing graph data and working on the artboard.

#### See also

### Adjust column width or decimal precision

Adjusting the column width has no effect on the width of columns in the graph; it only lets you view more or fewer digits in a column.

With the default value of 2 decimals, the number 4 entered in a cell appears in the Graph Data window box as 4.00, and the number 1.55823 entered in a cell displays as 1.56.

### Enter graph data

You use the Graph Data window to enter the data for your graph. The Graph Data window appears automatically when you use a graph tool and stays open until you close it.

- A.
- Entry text box
- B.
- Import data
- C.
- Transpose row/column
- D.
- Switch x/y
- E.
- Cell style
- F.
- Revert
- G.
- Apply

Display the Graph Data window for an existing graph: select the entire graph with the Selection tool, and then choose Object > Graph > Data.

Enter data in any of the following ways:

Select a cell in the worksheet, and enter the data in the text box at the top of the window. Press Tab to input the data and select the next cell in the same row; press Enter or Return to input the data and select the next cell in the same column; use the arrow keys to move from cell to cell; or simply click another cell to select it.

Copy data from a spreadsheet application such as Lotus® 1‑2‑3 or Microsoft Excel. In the Graph Data window, click the cell that will be the upper‑left cell of the data you paste, and choose Edit > Paste.

Use a word-processing application to create a text file in which the data for each cell is separated by a tab, and the data for each row is separated by a paragraph return. The data can only contain decimal points or decimal commas; otherwise, the data is not plotted. (For example, enter

`732000`, not`732,000`.) In the Graph Data window, click the cell that will be the upper‑left cell of the data you import, click the Import Data button , and select the text file.

Note: If you accidentally enter graph data backward (that is, in rows instead of columns, or vice versa), click the Transpose button to switch the columns and rows of data. To switch the x and y axes of scatter graphs, click the Switch X/Y button .Click the Apply button or press the Enter key on the numeric keypad to regenerate the graph.

### Use graph labels and data sets

Labels are words or numbers that describe two things: the sets of data you want to compare, and the categories across which you want to compare them. For column, stacked column, bar, stacked bar, line, area, and radar graphs, you enter labels in the worksheet as follows:

- A.
- Data set labels
- B.
- Blank cell
- C.
- Category labels

#### Enter labels

If you want Illustrator to generate a legend for the graph, delete the contents of the upper‑left cell and leave the cell blank.

Enter labels for the different sets of data in the top row of cells. These labels will appear in the legend. If you don’t want Illustrator to generate a legend, don’t enter data‑set labels.

Enter labels for the categories in the left column of cells. Categories are often units of time, such as days, months, or years. These labels appear along either the horizontal axis or vertical axis of the graph, with the exception of radar graphs, for which each label results in a separate axis.

To create labels consisting only of numbers, enclose the numbers in straight quotation marks. For example, enter

`"1996"`to use the year 1996 as a label.To create line breaks in labels, use the vertical bar key to separate lines. For example, type

`Total|subscriptions|1996`to produce the following graph label:Total

subscriptions

1996

#### Enter data sets for scatter graphs

A scatter graph differs from the other kinds of graphs in that both axes measure values; there are no categories.

Enter data‑set labels in every other cell along the top row of the worksheet, starting with the first cell. These labels will appear in the legend.

Enter

*y*‑axis data in the first column and*x*‑axis data in the second column.

#### Enter data sets for pie graphs

You organize data sets for pie graphs similarly to other graphs. However, each row of data in the worksheet generates a separate graph.

Enter data‑set labels as for column, stacked column, bar, stacked bar, line, area, and radar graphs. Enter category labels if you want to generate graph names.

To create a single pie graph, plot only one row of data, either all positive or all negative values.

To create multiple pie graphs, plot additional rows of data, either all positive or all negative values. By default, the size of the individual pie graphs is proportional to the total of each graph’s data.

#### Enter data sets for column, bar, line, area, and radar graphs

After you enter the labels for your graph, you’re ready to enter each set of data under the appropriate column.

- Column, stacked column, bar, stacked bar graphs
- The height of the column or length of the bar corresponds to the amount being compared. For column or bar graphs, you can combine positive and negative values; negative values appear as columns extending below the horizontal axis. For stacked column graphs, numbers must be all positive or all negative.
- Line graphs
- Each column of data corresponds to one line in the line graph. You can combine positive and negative values in a line graph.
- Area graphs
- Values must be all positive or all negative. Each row of data entered corresponds to a filled area on the area graph. Area graphs add each column’s values to the previous column’s totals. Therefore, even if area graphs and line graphs contain the same data, they appear substantially different.
- Radar graphs
- Each number is plotted on an axis and connected to the others in the same axis to create a “web.” You can combine positive and negative values in a radar graph.

## Formatting graphs

### Formatting and customizing graphs

Graphs can be formatted in a variety of ways. For example, you can change the appearance and position of the graph’s axes, add drop shadows, move the legend, and combine different graph types. You can view the formatting options for a graph by selecting a graph with the Selection tool and choosing Object > Graph > Type.

You can also manually customize your graph in numerous ways. You can change the colors of shading; change the typeface and type style; move, reflect, shear, rotate, or scale any or all parts of the graph; and customize column and marker designs. You can apply transparency, gradients, blends, brush strokes, graphic styles, and other effects to graphs. You should always apply these types of changes last, because regenerating the graph will remove them.

Keep in mind that a graph is a grouped object that is related to its data. Never ungroup the graph; if you do, you cannot change the graph. To edit a graph, select the parts you want to edit without ungrouping the graph, using either the Direct Selection tool or the Group Selection tool.

It is also important to understand how elements of a graph are related. The entire graph with its legends is one group. All the sets of data are a subgroup of the graph; in turn, each set of data with its legend box is a subgroup of all the sets of data. Each value is a subgroup of its set of data, and so on. Never ungroup or regroup objects that are within the graph.

### Change the graph type

Select a graph with the Selection tool.

Choose Object > Graph > Type, or double-click the graph tool in the Tools panel.

In the Graph Type dialog box, click the button that corresponds to the desired graph type, and click OK.

Note: Once graph objects are painted with gradients, changing graph types can cause unexpected results. To prevent undesirable results, either do not apply gradients until the graph is finished, or use the Direct Selection tool to select gradient-painted objects and paint those objects with a process color; then reapply the original gradients.

### Format a graph’s axes

With the exception of pie graphs, all graphs have a value axis which displays the unit of measurement for the graph. You can choose to display the value axis on one side or both sides of the graph. Bar, stacked bar, column, stacked column, line, and area graphs also have a category axis which defines the categories of data in the graph.

You can control how many tick marks appear on each axis, change the length of tick marks, and add a prefix and suffix to numbers on the axis.

Select the graph with the Selection tool.

Choose Object > Graph > Type, or double-click the graph tool in the Tools panel.

To change the position of the value axis, select an option from the Value Axis menu.

To format tick marks and labels, select an axis from the pop‑up menu at the top of the dialog box, and set the following options:

- Tick Values
- Determines the placement of tick marks on value axes, left axes, right axes, bottom axes, or top axes. Select Override Calculated Values to manually calculate the placement of tick marks. Either accept the values set when you created the graph or enter a minimum value, a maximum value, and the number of divisions between labels.
- Tick Marks
- Determines the length of tick marks and number of tick marks per division. For category axes, select Draw Tick Marks Between Labels to draw tick marks on either side of the labels or columns, or deselect the option to center tick marks over the labels or columns.
- Add Labels
- Specifies a prefix and suffix for numbers on value axes, left axes, right axes, bottom axes, or top axes. For example, you can add a dollar sign or percent sign to axis numbers.

### Assign different scales to the value axes

If your graph has a value axis on both sides, you can assign a different set of data to each axis. This causes Illustrator to generate a different scale for each axis. This technique is especially useful when you combine different graph types in the same graph.

Select the Group Selection tool .

Click the legend for the data set you want to assign to the axis.

Without moving the Group Selection tool pointer from the legend, click again. All of the columns grouped with the legend are selected.

Choose Object > Graph > Type, or double-click the graph tool in the Tools panel.

From the Value Axis pop‑up menu, select the axis to which you want to assign the data.

Click OK.

#### See also

### Format columns, bars, and lines

For column, stacked column, bar, and stacked bar graphs, you can adjust the amount of space between each column or bar in the graph. You can also adjust the amount of space between the categories, or clusters, of data in the graph. For line, scatter, and radar graphs, you can adjust the appearance of lines and data points.

Select the graph with the Selection tool.

Choose Object > Graph > Type, or double-click the graph tool in the Tools panel.

To adjust the space between columns and bars in a column, stacked column, bar, or stacked bar graph, enter a value between 1% and 1000% in the Column Width, Bar Width, or Cluster Width text box.

A value greater than 100% causes the columns, bars, or clusters to overlap one another. A value less than 100% leaves space between the columns, bars, or clusters. A value of 100% moves the columns, bars, or clusters flush against each other.

To adjust lines and data points in line, scatter, and radar graphs, set the Mark Data Points, Connect Data Points, Edge‑to‑Edge Lines, and Draw Filled Lines options.

To change how columns, bars, and lines overlap, set the First Row In Front and First Column In Front options.

Note: Always select First Column In Front for area graphs; if you do not, some areas may not appear.

### General graph options

You can access general graph options by selecting the graph with the Selection tool and double-clicking the graph tool in the Tools panel.

- Value Axis
- Determines where the value axis (the axis that displays the unit of measurement) appears.
- Add Drop Shadow
- Applies drop shadows behind the columns, bars, or lines in a graph, and to entire pie graphs.
- Add Legend Across Top
- Displays the legend horizontally across the top of the graph instead of to the right of the graph.
- First Row In Front
- Controls how the categories, or clusters, of data in a graph overlap when the Cluster Width is greater than 100%. This option is the most useful when working with column and bar graphs.
- First Column In Front
- Places the column, bar, or line that corresponds to the first column of data in the Graph Data window on top. This option also determines which column is on top for column and stacked column graphs with a Column Width greater than 100% and for bar and stacked bar graphs with a Bar Width greater than 100%.
- Mark Data Points
- Places square markers at each data point.
- Connect Data Points
- Draws lines that make it easier to see relationships among data.
- Edge‑to‑Edge Lines
- Draws lines that extend across the graph, from left to right along the horizontal (x) axis. This option is not available for scatter graphs.
- Draw Filled Lines
- Creates a wider line according to the value you enter in the Line Width text box, and which fills the line with paint according to the specifications for that series of data. This option becomes available when you select Connect Data Points.

### Add drop shadows

You can apply drop shadows behind the columns, bars, or lines in a graph, and to entire pie graphs.

Select a graph with the Selection tool.

Choose Object > Graph > Type, or double-click the graph tool in the Tools panel.

In the Graph Type dialog box, select Add Drop Shadow, and click OK.

### Change the position of a legend

By default, the legend is displayed to the right of the graph. However, you can choose to display it horizontally across the top of the graph.

Select a graph with the Selection tool.

Choose Object > Graph > Type, or double-click the graph tool in the Tools panel.

In the Graph Type dialog box, select Add Legend Across Top, and click OK.

### Format pie graphs

You can change the placement of the legend and how wedges are sorted in pie graphs. You can also specify how you want to display multiple pie graphs.

- Select the graph with the Selection tool.
- Choose Object > Graph > Type, or double-click the graph tool in the Tools panel.
- Do any of the following:
To change the placement of the legend, select an option for Legend.

To specify how multiple pie graphs are displayed, select an option for Position.

To specify how wedges are sorted, select an option for Sort.

Percentages and legends are painted black by default. If a pie wedge with a dark background obscures a legend, repaint the dark background. Use the Group Selection tool to select the dark pie wedges, and paint the wedges using the Color panel or Swatches panel.

#### Pie graph options

- Legend
- Determines the placement of the legend.
- Standard Legend
- Places column labels outside the graph; this is the default. Use this option when you combine pie graphs with other kinds of graphs.
- Legends In Wedges
- Inserts labels into the corresponding wedges.
- No Legend
- Omits legends entirely.

- Position
- Specifies how multiple pie graphs are displayed.
- Ratio
- Sizes the graphs proportionally.
- Even
- Makes all the pie graphs the same diameter.
- Stacked
- Stacks each pie graph on top of the other, and each graph is sized proportionally to each other.

- Sort
- Specifies how wedges are sorted.
- All
- Sorts the wedges of the selected pie graphs from largest to smallest value proceeding clockwise from the top of the pie graph.
- First
- Sorts the wedges of the selected pie graphs so that the largest value in the first graph will be placed in the first wedge, and the rest will sort from largest to smallest. All other graphs will follow the order of the wedges in the first graph.
- None
- Sorts the wedges of the selected pie graphs in the order in which you entered values proceeding clockwise from the top of the graphs.

### Combine different graph types

You can combine different graph types in one graph. For example, you may want one set of data to appear as a column graph and other sets of data to appear as a line graph. You can combine any type of graph with any other, with the exception of scatter graphs. Scatter graphs cannot be combined with any other graph type.

### Format the text in a graph

Illustrator uses a default font and font size when generating text for the graph’s labels and legend. However, you can easily change the formatting of type to add visual interest to your graph.

- Select the Group Selection tool .
- Click once to select the baseline of the type you want to change; click twice to select all of the type.
- Change the type attributes as desired.

## Adding pictures and symbols to graphs

### About graph designs

You use graph designs to add illustrations to columns and markers. Graph designs can be simple drawings, logos, or other symbols representing values in a graph; they can also be complex objects that contain patterns and guide objects. Illustrator comes with a variety of preset graph designs. In addition, you can create new graph designs and store them in the Graph Design dialog box.

You can apply graph design to columns in several ways:

- Vertically scaled design
- Is stretched or compressed vertically. Its width does not change.
- Uniformly scaled design
- Is scaled both vertically and horizontally. The horizontal
spacing of the designs is not adjusted for the different widths.Vertically scaled graph design compared to uniformly scaled graph design
- Repeating design
- Stacks a design to fill the columns. You can specify the
value that each design represents, as well as whether you want to
chop or scale designs that represent fractions.Repeating graph with chopped design compared to repeating graph with scaled design
- Sliding design
- Is similar to a vertically scaled design, except that you
can specify where in the design to stretch or compress it. For example,
if you were using a person to represent data, you might stretch
or compress only the body, but not the head. Using the Vertically
Scaled option would scale the entire person.Sliding graph design

### Import a column or marker design

Illustrator comes with a variety of preset designs that you can use in your graphs. You can also transfer the graph designs you create between documents.

- Choose Window > Swatch Libraries > Other Library.
- Do one of the following:
To import preset graph designs, navigate to the Cool Extras/Sample Files/Graph Designs folder inside the Illustrator application folder. Then select a graph designs file, and click Open.

To import graph designs from another document, select the document, and click Open.

Initially, all that appears is a new panel with colors, gradients, and patterns from the imported file. However, the imported graph designs will be available when you open the Graph Column or Graph Marker dialog box.

### Create a sliding column design

- Create a rectangle as the backmost object in the design. This rectangle is the boundary for the graph design.
- Create the design using one of the drawing tools, or place an existing design in front of the rectangle.
- Use the Pen tool to draw a horizontal line to define where the design is to be stretched or compressed.
- Select all parts of the design, including the horizontal line.
- Choose Object > Group to group the design.
- Use the Direct Selection tool or Group Selection tool to select the horizontal line. Be sure to select only the horizontal line.
- Choose View > Guides > Make Guides.
- Choose View > Guides > Lock Guides to remove the check mark next to Lock so you can unlock the guides. Move the design around to make sure that the guide moves with the design.
- Use the Selection tool to select the whole design.
- Choose Object > Graph > Design.
- Click New Design. A preview of the selected design appears.
- Click Rename to name the design.

### Create a marker design

- Select and copy a marker rectangle from the graph, and paste it where you're going to create your design. This will be the backmost object in your graph design and will establish the size of the marker.
- Make the marker artwork the size you want it to be in the graph, even if it’s larger than the marker rectangle you copied.
- Once you’ve got the marker design the way you want it, select the design, choose Object > Graph > Design, and click New Design.
- Click Rename to name the design.

### Reuse a graph design

You can reuse a graph design that you created and edit it to make a new design. If you have the original artwork, you can alter it and then rename the design using the Graph Design dialog box.

If you don’t have the original artwork defined as a graph design, you can retrieve the original by pasting the graph design into your artwork.

- Choose Select > Deselect to deselect all of the artwork.
- Choose Object > Graph > Design.
- Select the graph design that you want to paste into your artwork, and click Paste Design.
- Click OK. The graph design is pasted into your artwork. You can now edit it and define it as a new graph design.