Data visualization using Illustrator

From TOI-Pedia


Introduction

This article covers basic techniques for data visualization using Adobe Illustrator.

Illustrator Basics

We're not going to cover all basics here. If you're entirely new to Illustrator, please read up in the Illustrator_Basics article. Below is a quick recap of some of the most important tools that you'll use for this article.


Illustrator toolbox annotaed with graph.png


Selection tools: Illustrator has two selection tools:

Selection tool
select entire objects to move or transform the object as a whole.
Direct selection tool
to select components of geometry, such as points or lines.


Every object has two properties for color:

Fill color
fill color of the object. Can also be transparent.
Stroke Color
color of the border of an object. Can be transparent.

Text

Use the text tool to add text to your graphics. When you single click the text tool, you'll create a single-line text. It's recommended to use the text tool to draw a rectangle (box) to hold multi-line text. It offers more control over positioning and alignment.

Besides the regular ways of adding text, Illustrator also has the option to make text follow a line or fit within a drawn shape.

Illustrator text options.jpg


Character Type panel in Illustrator
Paragraph Type panel in Illustrator

Use Window » Type » Character and Window » Type » Paragraph to open the panels with text settings. The most important settings to work with are:

Font family
Type of font to use for the text. Choose it carefully. Fonts such as Comic Sans won't be taken seriously. Sans-serif fonts, such as Helvetica tend to be fairly neutral. Determine the audience for your graphics and which message you want to convey and choose a font accordingly. Look through the list and try which one works best.
Font size
size of the text. Headings should typically be the largest, annotations and such should be smaller.
Font style
you can make text bold or italic. Bold text can be use to give emphasis to a particular word or part of a sentence. Italic text is often used for quotes or specific terms.
Text alignment
Align your text (works only for text boxes, not for single line).

Colors

Adobe Kuler panel in Illustrator

Colors are very important in data visualization. Choose your colors carefully and make sure they convey the right message, are clear and go well together. Keep it simple; using too many different colors will cause a graphic to become cluttered and that doesn't work well.


You could use Adobe Kuler to assemble a nice color scheme. There's an extension in Illustrator and Photoshop: Window » Extensions » Kuler that allows you to browse the online Kuler collection and import them into your color swatches library directly.


Color Swatches panel in Illustrator

To create your own, go to the Adobe Kuler website. You need an Adobe ID to sign in to be able to save and export your color themes. Download them as .ASE file. In Illustrator, open the Color Swatches panel and click Illustrator swatches library menu button.png (Swatches Library Menu), choose "Other Library" and open the .ase file you downloaded from Adobe Kuler.


Any color palette (or theme) is managed from your Color Swatches panel. Make a habit of using it and directly adding new colors to your swatches when you apply them. This allows you to re-use colors more efficiently and keep your colors consistent. When you click the Illustrator new color swatch.png (New color swatch) button, it is automatically set to the current fill or stroke color, so adding it to your swatches is a breeze.


You can use the Eyedropper Tool to get both the fill and Stroke color from any existing object in Illustrator. This will set those colors into the color fields of the Toolbox. To add them to your color swatches, use the New color swatch button in the color swatches panel (see above).

Images

Besides using text and colors, images are very useful to visualize data and especially to explain what kind of data is being visualized. There are basically two kinds of images that can be used within Illustrator, vector images and bitmap raster images. Both have advantages and disadvantages.

Vector images, i.e. AI (Illustrator), DXF/DWG (Autocad) and SVG, are very useful for images where sharp and hard edges between colors are desired. These images are made out of vectors, which means the images are mathematically defined. The images will remain sharp no matter how big or small you scale them. Vector images are very useful for images with a small number of different colors, like technical drawings, logos and icons. Vector images are less suited for images with a large number of colors, because with larger numbers of colors, vector images become less efficient. Vector images can either be created within Illustrator or external files can be placed into Illustrator.

Bitmap raster images, i.e. JPEG, PNG and PSD (Photoshop), are very useful for images with gradually changing colors. These images are made out of pixels, and the pixel resolution (the amount of pixels per inch) defines the sharpness of the image. Bitmap raster images are very useful for images with a large number of different colors, like photos and renders. Images with a very small number of colors will look less sharp, due to the gradual changes from one color to another. To make them look sharp, a high pixel resolution is needed, making the bitmap raster image less efficient. Bitmap raster images need to be placed into Illustrator.

In data visualization, the use of icons (easy to understand simplified images) can help explain what kind of data is being visualized. In most cases a picture is worth a thousand words.

Illustrator icon.jpg

Graphs

Create Graphs in Illustrator

You can create several basic types of charts directly in Illustrator. In most cases, this is fine, as graphs used for data visualizations should be fairly simple in most cases. One of the main downsides is that it tends to get a bit more difficult when your data is still changing, so for research purposes, it is less suited. But for presentations, it works for basic graphs and charts.


Illustrator Toolbox Graph Tool foldout

The image right shows you the types of charts Illustrator supports. To visualize patterns over time, the Column Graph and Line Graph are most commonly used. To visualize proportion, you could use stacked columns or Pie charts. Alternatives for visualizing proportions are covered in the Visualizing Proportions section.


Click the tool of the type of chart you want to create and draw a rectangle on your artboard to set the size of the graph. The Data editor window opens. Enter your values into the cells on the first row:

Illustrator basic column graph with data editor.png


If you enter data on the second row, Illustrator creates two sets of values side by side:

Illustrator 2sets column graph with data editor.png

If you specify row or column headers, Illustrator will use these to create a legend and place a label. the options are limited however, so in many cases you can just as easily create them yourself. Maybe a bit more work, but also more control. Color legends are not needed for simple bar graphs; annotations and proper labeling usually work better. Labels, annotations and colors are best changed after the basic setup of your graph is complete.


Use the Direct Selection Tool to select parts of your graph and use the Color Swatches panel to change the colors.


To add labels, use the Text tool and draw a rectangle underneath the first column (bar). In our example the label is "Q1". Now for the other labels we're going to use a nice shortcut:

Select the first label with the Selection Tool. To create a copy, hold Alt (Windows) or Option (Mac) and drag the object to the second label location. This creates a copy of the object on that location. Now we want to repeat this, but instead of doing it manually again, we're going to use Control + D (Command + D on mac) to repeat the duplicate over the same distance we moved the first one. When you do this twice, you have your four labels, which should line up quite nicely.


Change the text of the labels (they are still the same because we copied them). Once done, select the labels of this first set, and Alt/Option drag them to the second set. The result would look something like this:

Illustrator 2sets column graph with labels.png


To finish the graph, add a heading and add labels to the vertical axis, so it's clear what the graph shows.


If you need to change the data of the graph, select the graph using the Selection Tool and go to Object » Graph » Data....


You may want to change things like the ticks on the axes, or remove parts of the graph. This cannot be done while the graph is still a graph object that is controlled by Illustrator; it won't allow you to. To do that, you must convert the Graph object into 'normal' objects. select the graph and go to Object » Ungroup. Illustrator will show you a warning that this will break the graph, making it impossible to quickly change the graph by editing the data. So only do this when you're sure the data is final.

Importing data in the Graph Tool

You can import your data in the Data editor of the Graph Tool. If you have data in Excel or any other spreadsheet, export it in a Tab delimited text format.


Click Illustrator data editor import.png (Import data) and browse to the text file. When the file is in the right format, the data should apear in your data editor.


Importing graphs from other sources

You can get graphs from various sources and place them into Illustrator. If you want to be able to edit them, they need to be in some sort of Vector format, such as: PDF, EPS, or SVG.


Microsoft Excel: You can copy-paste graph objects from Excel. They will be vector objects in Illustrator.


Online tools: if online tools allow you to export graphs in any vector format (pdf, eps, svg), you should be able to open them in Illustrator. If they only allow you to save the graph in bitmap formats, such as jpg, png or gif, you won't be able to edit them, but you can still include them in your graphic.

Adding Annotations

Annotations can emphasize the important data in a graph or image. To add annotations to your graph or image, you could use the Illustrator pen tool.png (Pen tool) or the Illustrator line tool.png (Line tool).

Illustrator annotations.png

Stroke panel in Illustrator
Use Window » Type » Stroke to edit the type of line used.

Stroke weight is the thickness of the line. Here you can give a certain weight or thickness to a line or shape. Select the object you want to change, then type in a number numerically, use the arrows to in- or decrease the value or select one from the list.

By default, the weight is in points (pt), but you can also use millimeters (mm). Just type in your preferred value and add mm behind it. The weight will be converted to points accordingly.

Dashed or dotted lines are fairly easy to make in Illustrator. In the stroke panel click on the Illustrator show options.png (Show options) in the top right corner of the stroke panel, this will unfold some extra stroke options. Now click on the item(s) you want to make dashed, check the dashed line box, and enter values for the lines or dots and gaps (holes between the lines). Obviously depending on how big your drawing is, you should choose small or large numbers. Make your own variation or look up official patterns.

If you want to make a continuous line from a dashed line, select that line, and uncheck the dashed line box in the stroke menu.

Arrowheads can be added to the beginning and end of a line. Select a scale (size) and a type for the beginning of the line and for the end of the line.

Visualizing Proportions

There are several ways to visualize proportions. The Pie or Donut chart are well known. But you can also use stacked bars or area graphs, which work well when proportions that change over time are visualized.

Another option is to create a Tree Map or visualize proportions by arranging objects or icons and using the amount of copies or the scale.

Pie Graph

Use the Pie Graph tool to create a pie chart. Enter your data items in the first row. When working with percentages, make sure they add up to 100. Sort items from largest to smallest!


Illustrator simple pie graph.png


Move a slice to make it stand out

When coloring your pie graph, in most cases you want to arrange your colors from dark to light, unless there is a particular item you want to stand out.

You can also select a slice of the pie and move it to make it stand out. Use the Direct Selection tool to select the slice.


When you enter labels in the first row of your data editor, Illustrator will generate a legend. But using a color legend on a Pie chart is not recommended. Place labels in or next to each slice.

Bubble chart

Instead of a single pie graph, you can also create bubbles that are scaled according to their value. When you create a Pie graph, you can enter each data item in a new row. Illustrator creates a pie for each row in your data set. These are scaled according to the value.

Illustrator simple bubble chart.png


Change colors by selecting the bubbles using the Direct Selection Tool. once selected, you may also want to rearrange them to get a nice tight pack. Add labels by using the text tool. You may consider changing the font size to correspond to the size of each bubble.

Illustrator rearranged bubble chart.png


If you've entered your data in columns, use the Illustrator data editor transpose button.png (Transpose row/column) button in the data editor to switch.


Treemap

Unfortunately, Illustrator doesn't support Treemaps, nor does Excel. We've created a simple online tool that allows you to create simple treemaps.

Arranging items

Another way to visualize proportions is to create grids of icons or other graphics. The amount of objects is used to visualize the proportion. To make it readable, you need to arrange them neatly.

Illustrator transform array single row.png

Draw your own shapes, or place vector graphics or bitmap images File » Place from outside your document. Select it (create a group if it consists of multiple shapes) and use Effect » Distor & Transform » Transform.... Set the number of copies and select a vertical or horizontal distance. Use the Preview option to see the result before applying it.

You can repeat this to duplicate the row of objects.

If at any time you want to change the spacing, move the last object to its new position and use the Window » Align panel:

Illustrator align panel.png

Using the Distribute horizontally or vertically, you can evenly space selected objects. Use this tool on an single row or column of objects. Using it on a 2D array of object usually doesn't work well.

Advanced method

The Appearance panel in Illustrator

A more advanced way of doing this, is to use effects in the Window » Appearance panel. Select the group or object and click Illustrator add new effect button.png (Add New Effect). Choose Distort & Transform > Transform... After you've set the first effect up to create a single row, add the transform effect for the second time to create mutliple rows. Illustrator will warn you that you're adding another instance of the same effect:

Illustrator another instance of effect warning.png

Click Apply New Effect and set it up to create multiple rows.


The nice thing of doing it this way is that you can change the transform effect at any time, making it much more flexible.


Illustrator 2d array using appearance effects.png

Using icons in a graph

There are many ways to use icons in a graph, here are two examples to show some of the potential.

Use of icons in a pie graph
By using icons instead of text in a graph it is clear to see what data is actually being visualized in the graph. A simple way of doing this is just by replacing the text with icons.


Make an icon part of a graph
A more advanced way is to use the icon as an actual part of the graph. You can achieve this by using the parts of the original graph to display only a certain part of the icon and leave the rest of the icon greyed out. There are just a couple of steps to get to this result.

The first step is to copy the icon and make sure it is in the exact same place as the original icon by clicking ctrl+c and got to Edit » Paste in Back. We now have two icons right on top of each other.

The next step is to grey out the icon on the back by selecting it and going to Window » Transparency. Set the opacity of the icon to the desired value (this can be changed later). We still don't see the greyed out version of the icon, because the original icon is still completely covering it.

The last step makes part of the icon disapear so it acts as a part of the graph. This can be achieved by using a Clipping mask. The original parts of the graph can be used as the Clipping mask.

Personal tools
Actions
Navigation
Tools