logo

1 303 279 1021

Loading

Live Chat

All Issues

Golden Software Newsletter

Our newsletters are filled with interesting technical tips, news of how people are using Surfer, Grapher, Voxler, MapViewer, Didger and Strater, and (of course!) great illustrations.

Subscribe to Our Newsletter

Issue 61

Creating and Using Bar Charts

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

This article discusses data layout for bar charts, creating grouped bar charts and displaying the bars as adjacent or stacked, creating grouped bars from multiple data files, and using 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 chart. 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:

 

Data Layout for Bar Charts
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.

Creating Grouped Bar Charts from the Same Worksheet
To create the first bar chart, use the Graph | 2D XY Graphs | 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 on the Bar Chart 1 object.
  2. In the Property Inspector, click on the Plot tab to open the plot properties. Scroll all the way down and click the New plot command where it says <Click here to add a new plot>. The second bar chart is automatically added from column C. When the data is in the same worksheet and created using the New plot command, the bars are automatically grouped together.
  3. Click on the Fill tab to change the color of the newly created bar chart so that each set of bars are separate colors.
  4. These bars can either then be stacked or adjacent. To switch between stacked and adjacent bars, click once on either bar chart to select it. In the Property Inspector, open the Plot tab. Change the Stacking command to the desired option.

     

    Stacked Bar Plots Adjacent Bar Plots
    The bar charts on the left are stacked. The bar charts on the right are adjacent.

     

Creating Grouped 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:

 

Second Bar Chart Data File
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. Choose Graph | 2D XY Graphs | 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, choose Graph | Add to Graph | Plot. Select Bar Chart and click OK. Click OK in the Choose Axes dialog, selecting the same axes. In the New Worksheet dialog, select the new worksheet and click Open. The second set of bars is automatically created.
  3. Click on 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 on either the Bar Chart 1 or Bar Chart 2 object.
  2. In the Property Inspector, click on the Bar Chart Groups tab to open the grouping properties.
  3. Click the Add group command where it says <Click here to add a group>.
  4. In the list of plots under Group 1, check the boxes next to Bar Chart 1 and Bar Chart 2. The bar charts are now grouped.
  5. 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 Inspector, open the Plot tab. Change the Stacking command to the desired option.

     

    Grouped Bars from Different Worksheets
    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 8, any image can be used to fill the bar chart. So, instead of blue and red 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 Inspector, open the Plot tab.
  3. Change the Bar style to Image.
  4. Click on the Set image command where it says <Click here to set image>.
  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.
  8. Check the Use full image option to only allow the full image to stack. 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.

 

Oil Can Image for Energy Consumption Graph
Using an image for bar chart fill increases the effectiveness of your graph.
 

Trusted by over 10,000 Companies and Schools


Snow Depth Map for Colorado Ski Resorts

Image Interested in creating a cool map of snow depth for Colorado Ski Resorts? Here's how to do it! First you'll need to get the snow depth information... Read More

Subscribe to Our Newsletter

Enter your email address below to receive email notifications of product updates and our newsletter, filled with helpful technical tips and case studies.