Creating and Using Bar Charts in Grapher

Grapher can display bar chart data in multiple layouts. Bars with the same coordinates can be stacked on top of one another or they can be adjacent to each other. In order to group bars this way, the bar location value of the needs to be identical. For vertical bar charts, this would be the X value; for horizontal bar charts, this would be the Y value.

Learn how to:

  • Data layout for bar charts

  • How to create grouped bar charts and display bars as adjacent or stacked

  • How to create grouped bars from multiple data files

  • and how to use images for bar chart display.

Creating Data for Bar Charts

Bar charts are plotted from columns of data. Each column is plotted as a single bar chart plot, with each row being a new bar. Therefore, each row should have a different bar location value. For a vertical bar chart, this means that each row has a different, unique X value. For horizontal bars, each row would have a different, unique Y value. This example data will generate bars that are evenly spaced 1 month apart:

Creating data for a bar chart in Grapher
The table shows three columns: Month, Kwh/mon 2009 and Kwh/mon 2008.
Using Month as the unique value will have bars spaced evenly at a one month interval.

 

Grouping Bar Charts from the Same Worksheet

To create the first bar chart, click the Home | New Graph | Bar | Vertical Bar Chart command. Select the data file and click Open. The bars are automatically created. To add a second bar chart using column C, follow these steps:

  1. In the Object Manager, click the Bar Chart object.
  2. In the Property Manager, click the Plot tab.
  3. Scroll all the way down and click the Create button in the New Plot field. The second bar chart is automatically added from column C. When the data is in the same worksheet and created using the Create New plot command, the bars are automatically grouped together.
  4. If desired, click the Fill tab to change the color of the newly created bar chart.
  5. These bars can either then be stacked or adjacent. To switch between stacked and adjacent bars:
    1. Click once on either bar chart to select it.
    2. In the Property Manager, click the Plot tab.
    3. Change the Stacking property to the desired option.
Bar chart examples in Grapher
The bar charts on the left are stacked. The bar charts on the right are adjacent.

 

Grouping Bar Charts from Multiple Worksheets

If your data is contained in multiple worksheets, you can still group data. For instance, here is a second data set that I would like to compare to my original data:

Data by months in Grapher
Average energy usage per month for focus area.

This data contains energy usage averages for our focus area. To compare the kilowatt-hours from the original data set with this data, use these steps:

  1. Click the Home | New Graphs | Bar | Vertical Bar Chart command. Select the original data file and click Open. The bars are automatically created.
  2. To add the second bar chart using the new data file, click Home | Add to Graph | Plot.
  3. Select Vertical Bar Chart and click OK.
  4. Click OK in the Choose Axes dialog, selecting the same axes.
  5. In the Open Worksheet dialog, select the new worksheet and click Open. The second set of bars is automatically created.
  6. Click the Fill tab to change the color of the newly created bar chart so that each set of bars are separate colors.

Notice that the second set of bars is overlaying the first set. Since we want the bars to be adjacent, we will need to force the two data sets to be a single group.

  1. In the Object Manager, click either of the Bar Chart objects.
  2. In the Property Manager, click the Bar Groups tab.
  3. In the list of plots under Bar Charts, adjust the selection so both Bar Chart 1 and Bar Chart 2 are in Group 1. The bar charts are now grouped.
  4. These bars can now be stacked or adjacent. To switch between stacked and adjacent bars, click once on either bar chart to select it. In the Property Manager, click the Plot tab and change the Stacking property to the desired option.

    Adjacent Category Bar Chart in Grapher
    Bar charts can be grouped so that they can be stacked or adjacent,
    even when the data comes from different worksheets.

     

Using Images for Bar Chart Fill

In Grapher, any image can be used to fill the bar chart. So, instead of solid filled rectangles, bar shapes can be cones, diamonds, spindles, or images. To change the bars to images:

  1. Click on the Bar Chart in the Object Manager.
  2. In the Property Manager, click the Plot tab.
  3. Change the Bar style to Image.
  4. Click the Load... button in the Set image field.
  5. In the Set Image dialog, click the Load Image button.
  6. In the Import dialog, select the image and click Open.
  7. Change the Repeat image option to allow the image to stack, if desired.
  8. Check the Use full image option to only allow the full image to stack, if desired. Without this option, you may have partial images to make the full height of the bar.
  9. Click OK to make the change to the graph. The bars will automatically update to show the image.
Bar chart with image fill in Grapher
Using an image for bar chart fill increases the effectiveness of your graph.
 
 
Updated May 2023
Was this article helpful?
13 out of 34 found this helpful

Comments

0 comments

Please sign in to leave a comment.