Join Mordy Golding for an in-depth discussion in this video Adding and customizing a stacked bar chart, part of Creating Infographics with Illustrator CC (2013).
If you've been working together with me using exercise files while watching this course, then now might be a good time to quit and restart Illustrator. This will actually delete all of Illustrator's graph preferences, because they don't keep each time you restart Illustrator and that way it's less likely that you run into problems as you follow through the rest of this chapter. Okay we are going to begin this project by creating the chart that appears at the very top of this infographic. Now I am going to switch over to Acrobat here because we are going to take a look at the finished product. We are going to see what it is that we are going to create; that is this chart that appears here across the top that shows the different percentages that make up 100% of the energy generation in the United States.
Now it's split between these five different types of energy: NUCLEAR, RENEWABLES, PETROLEUM, COAL and NATURAL GAS. We are also going to add these really cool icons in the middle, which we'll create from scratch together. We'll style this that it looks just like this, but the first step is to actually bring this data into Illustrator. So I am going to switch back to Illustrator here and actually before I do anything I want to save my own version of this document. So I am going to go to the File menu, I am going to choose Save As and I am going to go to the Project folder and I am going to rename this file renewable_energy, let's get rid of the word start and let's change it to _01.ai.
Now I want to save this as a native Illustrator file. When I save this, where it says over the here in the Options to create a PDF compatible file I'm going to uncheck that option. Now let's understand why I am doing that. Normally when you save an Illustrator document, Illustrator saves its own native information, which is required when you want to open up that file back inside of Illustrator again. But it also creates a PDF compatible version of that file; basically it just creates a PDF that it embeds into that document. This allows for several things. First of all, if I just save my native.ai file and I open it up inside of Acrobat, I'll be able to view that file inside of Acrobat because Acrobat will see that PDF file that's inside the file.
More importantly, if I'm taking my graphic and I want to place it into another application like maybe InDesign, InDesign doesn't know how to read Illustrator's native data, but it does know how to obviously display a PDF. So when I take a regular Illustrator file and I save it, I may not be aware, but Illustrator is putting a PDF document of that artwork into my document, so that now when I place it into InDesign, InDesign sees that PDF and knows how to display it and print it. But the truth is that when I'm working on an infographic, my intention is not to bring this into InDesign at all. My intention is to work with it completely inside of Illustrator. I am never really worried about bringing this into another application.
So by unchecking this I am doing two things. First of all, I'm reducing the size of my actual file size. If you think about it, Illustrator's native data takes up a certain amount of space and creating a full PDF version of that also takes up a significant amount of space, I would say it's probably almost half. So by un-checking this option I am now reducing my file size almost in half. Now more importantly, it also means that when I save my document, Illustrator doesn't have to worry about re-creating that PDF file anymore. So every time that I save my file, my saving will actually take twice as fast.
So when I know I am working on a document that's primarily going to be inside of Illustrator, I can be safe in turning off this option. Of course at any time if I decide that I now need to bring this infographic into InDesign, I could always just open it up inside of Illustrator and then when I choose Save As, just turn this checkbox back on again and now Illustrator will rewrite that PDF file into it. So now with that option unchecked I am going to choose OK, and now it's going to be easy for me to always just continuously save my documents, so I don't worry about losing any information as I work.
Now let's zoom in here at the top of the document, I am just going to press Cmd+spacebar or Ctrl+spacebar. That's going to give me my Zoom tool. I can now see that I am right now looking very close to this part of my file. I want to create a chart. Now according to the sketch that I've created I know that I want to create a stacked bar chart here. Now the truth is, I could always switch between different types of charts so this doesn't really make a difference. But since I know what I'm doing here, I am just going to go over here to my Graph tool, click and hold, choose the Stacked Bar Graph tool. Then I'm going to click and drag just to define an area here. I don't need to really worry about how big it is.
We are going to resize all that later; we just want to get this data into Illustrator. Now I can go one of two ways here, I can either bring some text data into Illustrator or I can go to Excel and just copy and paste that data. So throughout this project we'll actually explore two different ways of doing that. For now I am going to import the data. So I am going to go to this little button over here inside of the Graph Data Window called import data; I am going to click on that. I'll go to my Project folder inside of my exercise files and I'll click on the Data folder. I have provided all the data in both text-based format and also as a native Excel document in case you wanted to choose your preference.
I am going to choose here the Text option because when you're placing data into Illustrator, you cannot place a native Excel document. It has to be either a comma delimited or a tab delimited text document. So if I expand my window here, the data that I am looking for right now is something called US_Energy_Production_2011. I'll click Open and we can now see that that information has come in. Now it has two decimal places for this. I really only need one decimal place. So I can click on this button right here where it says Cell Style and I could change Number of decimals to 1, click OK and now I see that those zeros have disappeared.
So I have 10.6% for Nuclear, 11.7 for Renewable, 15.4 for Petroleum, 28.4 for Coal and 33.9 for Natural Gas. If I click the check mark over here to apply those settings, I'll now see that that one long bar has been split now into these five sections, proportional based on the values that are here. This is the beauty of working with Illustrator and with Graphs. Now if you look over here to the far right of my screen you can see that a legend has been created that identifies what each of these bars represent.
I am actually going to scroll over here just a little bit so you can see that. You can see Natural Gas, Coal, for example. But I don't really need this because I am going to be creating icons and adding some text on my own. So I can really kind of just focus on what I'm seeing right here. I don't need to have that information. Now there are two ways for me to get rid of it. One way is to just simply ungroup my graph and delete the elements. But I just want to show you that you can also work with the data itself. So if I don't include these text-based labels over here for example, Nuclear and Renewable Energy, then Illustrator does not create a legend for it.
Obviously it can't, because it doesn't know what those numbers actually represent. Since I already know that and I have the data to work with on my own, I can simply delete this text from the data window. Now I could delete it, but then it have an extra space over here, so let me just show you the easiest way about working in this what I might call a primitive dialog box inside of Illustrator. I am simply going to click over here to highlight the 10.6 value. Then I'll Shift+Click over here at the end to basically select these five different cells. I'll press Cmd+X or Ctrl+X to cut that data, then I'll simply click once here to select this cell and I'll hit Cmd+V or Ctrl+V to paste and now that data replaces what was there before.
So now when I click OK to update this, you can see that that legend on the right side here has disappeared. So basically now I have the information that I need to work with for this chart. So let's go ahead now and make some modifications to it. I can close my data window. I'm going to switch to my Selection tool and the first thing that I want to do in this case is I want to ungroup my graph. I no longer need access to the data itself. I want to start kind of taking what Illustrator has given me here, and I want to make it format or fit within the design that I intend it to be. So I am going to start by choosing Object>Ungroup.
Now Illustrator is going to give me a warning. It's going to tell me, by the way, as soon as you ungroup this, I won't be able to modify that data anymore and that's okay. So I am going to click Yes in this case, and now it's simply a group. Now what I'm going to do is I am going to double-click on this group to isolate it. Now I'm basically inside the group, or more specifically, I have isolated this group from anything else in my document. So like, you can see that everything else is kind of faded back. I can't select anything else. Even if it were unlocked I would not be able to select it because right now Illustrator only lets me work with the elements that are here inside this group. I just wanted to show you that inside this group there are other elements here as well.
I can click and drag to select all of these elements here and I am going to hit Cmd+X to cut it to basically to my pasteboard. Now I am going to double-click again so that I am out of isolation but I've just clicked on any area outside that. Now I am now going to click on these elements here to delete them. I don't need all these elements at all, you know the value axis and the category axis, because again I'm completely customizing this chart. Now I'll press Cmd+V or Ctrl+V to paste these elements here before. Now let's go ahead and start styling this and getting it to fit into the way that I want it to appear.
Well first of all I don't want a stroke weight on any these things, so let's get rid of the stroke on it. So I am simply going to go ahead now to the top here of my Control panel and I am going to choose None for the Stroke Weight. So now I'd have no stroke applied to this at all. I can go ahead and deselect that and you can see now the strokes have disappeared. Now I do want to change the actual size of this. Now if I click on one of these right here, it doesn't make a difference since this is all a group it all now becomes selected. Here is the beauty about working inside of Illustrator, because I can start to use these mathematical settings to position this and size it just the way that I want.
Now first of all, I want this centered right here on my screen. So I am going to click on this icon right here inside of my Control panel called Align to Selection, but it's really an icon that lets me choose what I want this to be aligned to. You can see that right now if I click on this little arrow, Align to Selection is currently selected. But I want to change it to Align to Artboard. When I do that, Illustrator does something very interesting. It figures, hey, if you want to align something to the Artboard maybe you now want to align that art. So I now see all the align settings appear inside the Control panel. They were hidden before, but now they become visible.
If I click on the Center button right here, Horizontal Align Center, Illustrator is now going to align that group to the center of my Artboard. Now I also want to adjust the size of this. So I am going to click on the Transform option over here. I am going to make sure that the Proxy button here is set in the center, what we call the reference point. That means that if I make any changes to my artwork, they're all going to happen from that origin point. So since I have centered this in my page and since I now have my reference point set to the center, any adjustments I make are going to happen from the center of this group.
Now I want to make modifications now to the actual Width and Height of this. So right now the Width is a little bit more than 10 and a quarter, but I want this to be exactly 10 and a quarter, because that's actually going to match the width of this bar right here. So where it says Width I am going to type in 10.25 and hit the Enter key. That's now going to accept that value and it's now exactly the same width as that green bar. Now I also want to modify the height of this. So once again I click on Transform. Where it says Height, I'll change this to 1.25 or one and a quarter inches.
I could press Enter to accept that and now I am starting to really see this bar turn into more of a graphical chart that I am going to create. I am going to take this right now and just simply click and drag holding the Shift key. You can see because I have my Smart Guides turned on it's going to snap right here to that green spot. Let me go head now and deselect this. What I've been able to do now is use Illustrator's Graph tool to simply create an object in the correct proportions for me to show the percentage of each of these different energies as they contribute to the whole.
Now I am going to switch to my Direct Selection tool because I want to start adding some colors here. The first one here was this value that I have used for Nuclear Energy. By the way, even though I have now ungrouped this graph, remember I still always have access to the original data that I've been working with. So I am actually going to switch over to Excel for a second here, because this is the Excel version of that data that I had. I could always come back and reference this so I can make sure okay these are what those values were. If you don't have Excel available you can always use the text-based version that I have provided as well.
So let's go back into Illustrator. The first one is Nuclear and I've already created different colors for these different types of energy. So I'm going to choose the swatch here called Nuclear for this color. I'll go ahead and select this one; this is the Renewable Energy one. This one focuses on Petroleum; this one here is this color for Coal; the last one is this blue color for Natural Gas. So now I've gone ahead and I've applied the colors for this. But I really want to help kind of drive home the fact that I want to be able to make it easy for people who are looking at this infographic to identify what each of these different parts of the chart or what each of these colors represent.
Sure I can write the words Nuclear and Renewable and Petroleum for example, but I also want a graphical way to be able to convey that information. How about if we create some icons that help us identify what types of energy sources we are talking about here. Well, that's what we are going to cover in the next movie. We'll actually create beautiful icons for all of these different five energy sources. Before we do that however, let's remember to save our document. So I am going to press Cmd+S or Ctrl+S to save my document and now I'm ready to create some really cool icons.
- Visualizing data vs. presenting data
- Understanding the anatomy of an Illustrator graph
- Formatting data with Illustrator
- Defining the scale for charts
- Adding numeric values
- Designing your own chart from scratch
- Creating simple icons
- Building line, bar, column, and matching-scale charts
- Adding a table with threaded text
- Creating a layered PDF for distribution