Spreadsheets 3: Charts and Graphs Name: Main: When you have finished this handout, you should have the following skills: Setting up data correctly Labeling axes, legend, scale, title Editing symbols, colors, fonts, etc. Choosing correct type of graph What Makes a Graph a Good Graph? Graphs allow you to form ideas about data quickly and easily. Good graphs: have a title that describes what the graph is about have labels for the different parts of the graph have a key to explain what different colors or symbols stand for are the right kind of graph for the data It is very important to think about what kind of graph you want to make. In this handout, you will learn about three different kinds of graphs and charts: line graphs, bar graphs and pie charts. Which kind of graph you make depends on the data you have. In general, line graphs are used when you are looking at changes in data over time, especially when you are comparing two or more things over time. Line graphs are also used to show changes in the rate of something. A line graph has an X and a Y axis, and the data for both axes changes in important ways. In this handout you will graph changes in the high and low temperatures for an imaginary week in February. bar or column graphs are used when you are comparing measurements for a group of things. A bar graph also has an X and a Y axis, but only the data in the Y axis changes in important ways. In this handout you will make a bar graph for the heights of a group of people. pie charts are used to show the different amounts of something out of a whole. In this handout, you will make a pie chart showing the breakdown of students with different eye colors. Page 1
Entering Information into the Spreadsheet When you are making a chart or graph using a spreadsheet, it is also important to think about how to arrange your information in the cells of the spreadsheet ahead of time, because this will affect how the computer arranges the information in the chart or graph. Here are some general rules that will help you enter your spreadsheet information in a sensible way: Give each column of information a title that describes the information. The title will appear in your graph as a label for the legend. If you are making a graph with an X and a Y axis (a bar chart or a line graph, for example), put the information that is NOT a measurement or other data into a column on the far left. This will be used to enter text information such as the date, people s names, etc. The information in the first column will become the x-axis. Put the column(s) with data to the right of the text information column. These will become the y-axis. The rest of this handout will explain how to create each of the three kinds of graphs and charts we are studying in this unit: line, bar and pie. First: q Open a new spreadsheet workbook in Excel. q Go to View-->Toolbars and make sure both Standard and Formatting have checkmarks. q Create a header with your name, date, and main on the right, and the title Charts and Graphs in the middle. Creating a Line Graph q Enter the information shown in the picture to the right. NOTE: When you type 2/1 for a date, Excel will convert it to 1-Feb in your spreadsheet. q Save your file as graphs(yi). Page 2
q Highlight the cells beginning with A1 and ending with C8. Go to Insertà Chart or click on the Charts tab in the Ribbon, then on the Insert Chart button in the Ribbon. q Scroll down to the Line area and choose "Marked Line." q You should see a graph that looks something like this: q As you can see, your graph may be squished. Don t worry about that for now. Page 3
q Adding a title to your chart: A good chart should include a title so that the reader knows what the chart is about. To title your chart, go to Chart Layout in the Ribbon. q Then click on the Chart Title button and choose Title Above Chart. q Click inside the Chart Title area that you have just added and type Temperature Comparison, as shown in the pictures below: q Save your work. Page 4
Labeling the x and y axes: A good chart should also include labels for the x and y axes so that the reader knows more about the data. q Make sure your chart is still selected. Then go to Chart Layout-->Axis Titles in the Ribbon and select Horizontal Axis Title-->Title Below Axis as shown in the picture at right: q Where it says Click here to add title, type Date as shown in the pictures below. Repeat this step to label the Vertical (Value) Axis (choose "Rotated Title") with Temperature ( C). To make the degree ( ) symbol, hold down the Shift and Option keys while typing the number 8. Your graph should look something like this now. Page 5
q Drag your graph to the left so that it below row 9 (to keep it on the same page as your data). q Changing the graph font and size: While the graph is still selected (with the blue border), go to the Font area at the top of the window. Change the font to Times New Roman and the size to 10. If you can't find the Font area, go to View-->Toolbars and make sure Formatting has a checkmark next to it. q Your graph should now look something like this: Page 6
q Changing the units on the Y axis: Your graph may be set so that the scale on the Y axis is in units of 2 (or even 5, depending on how it is sized), but you will change it to units of 3. To do this: q Open the Format Axis window by double-clicking the Y axis (as shown in the picture to the right), or in the Ribbon, go to Chart Layout-->Axes-- >Vertical Axis-->Axis Options I q n the Format Axis window, click on Scale. Next to Major unit type a 3, as shown in the picture below (left). Then click OK. Now the Y axis on your graph should look something like the picture below on the right. Page 7
q Changing the symbols on your graph: Double-click on one of the diamonds on the high temperature line in your graph. The Format Data Series window should open. On the left of the window, you can see a list of all the parts of the line that you can change. Using the pictures below to guide you, make the following changes to the High Temp line: line color = orange; line weight = 6 pt; marker style = circle; marker fill = solid and green. When you have made all of these changes, click OK. q Your graph should now look something like this: q Save your work. Page 8
Creating a Column Graph q For the next graph, you will keep the same spreadsheet file open (graphs(yi)). However, you will enter the data for your column graph on a new sheet (Sheet2) by clicking on the + tab at the bottom of the window to insert a new sheet. q Enter the data on Sheet 2 as shown in the picture: q Highlight your data (cells A1 through B7). q Click on the Charts button and then the Column button in the Ribbon and click on the Clustered Column chart type (as shown in the picture below: q Your chart should look something like this: q While your chart is still selected (has the blue frame around it), go to the Chart Layout tab in the Ribbon as you did for your line graph and do the following: change the font to Comic Sans, 12 pt; title your graph Class Heights; title your horizontal (x) axis Name; title your vertical (y) axis Height (in). When you are finished, your chart should look something like the picture at right. Page 9
q Drag your graph to the left so that it is just below row 9 and will fit on the same page as your data. q Changing the units on the Y axis: Double click on the Y axis ( Height ) to open the Format Axis window. Click on Scale and change the major unit to 5, as shown in the picture at right. Then click OK. q Your numbers are probably all squished together now, so drag on the handles of your graph to stretch it so that all the numbers on the Y-axis show. Your graph should look something like this: q Changing the bar colors: Double click on any one of the blue bars on your chart to open the Format Data Series window. Then click on Fill and change the color to red. Then click OK. q Sorting the chart data: Click somewhere outside of your chart so that it is no longer selected. Highlight cells A1 to B7 again. Then go to Data-->Sort, sort the cells by the column "Height (inches)", and click OK. Your graph should now look something like this: q Save your work! Page 10
Creating a Pie Chart q For the next graph, you will keep the same spreadsheet file open (graphs(yi)). However, you will enter the data for your column graph on a third sheet by clicking on the + (Insert Sheet) tab at the bottom of the window to make a new Sheet 3. q Enter the data on Sheet3 as shown in the picture: q Highlight your data (cells A1 through B4). q Click on the Charts button and then the Pie button in the Ribbon and click on the Pie chart type (as shown in the picture below: q While your chart is selected, change the font to Arial, size 12. Change the Chart Title to Eye Color. q In the Chart Layout tab of the Ribbon, select Data Labels and then select Percentage as shown in the picture at right: q q Your chart should now look something like the picture at the right. Move your chart to the left under Row 6 to keep it on the same page as your data. Page 11
q Changing the slice colors: Double-click on the very edge of the slice that stands for blue eyes in order to open the Format Data Point window. Click on Fill and change the color to blue. Then click OK. q Repeat this step so that the slice that represents brown eyes is brown and the slice that represents green eyes is green. q Save your work. q Finally, rename each of your sheets by clicking on the tab at the bottom of the page for each sheet and typing the new names: Line Graph (Sheet 1), Column Graph (Sheet 2), and Pie Chart (Sheet 3). See the picture below for what you should end up with: q Print EACH of your three sheets, staple them and hand them in. Page 12