Suppose your bar chart summarizes the following data for 4 quarters of 2003 and 2004:
Row Quarter Year Data Colors
1 1 2003 6 4
2 2 2003 7 4
3 3 2003 8 4
4 4 2003 9 3
5 1 2004 6 2
6 2 2004 7 2
7 3 2004 7 2
8 4 2004 7 2
Here are three different ways you could specify the colors of the bars:
Option 1 - Change the colors of the bars after the graph is created.
1. Select the bar or bars you would like to change. For more information on selecting elements on a graph, see Knowledgebase ID 1415.
2. Double-click the selected bar(s). Under Fill Pattern on the Attributes tab, choose Custom.
3. From the Background color drop-down menu, choose the color. Click OK.
Option 2 - Change the color of each cluster when creating the graph.
Suppose you want to make all of the bars for 2003 the same color and all of the bars for 2004 a different color:
1. Choose Graph > Bar Chart.
2. From the Bars represent drop-down menu, choose Values from a table.
3. Under One column of values, choose Cluster. Click OK.
4. In Graph variables, enter Data and in Categorical variables for grouping, enter Year Quarter.
5. Click Data View.
6. In Categorical variable for attribute assignment, enter Year.
7. Click OK in each dialog box.
Note: To change the default color for the bars of a cluster, follow the steps in Option 1.
Option 3 - Use an attribute column to specify the colors when creating the graph.
Suppose you want to use the Colors column to indicate the color of each bar. You want to make quarters 1-3 of 2003 blue, quarter 4 of 2003 green, and quarters 1-4 of 2004 red:
1. Choose Edit > Command Line Editor.
2. Type:
Chart Sum(Data)*Year;
Group Quarter;
Bar;
Color Colors.
3. Click Submit Commands.
Note: To see the graphics number coding scheme for Minitab, see Knowledgebase ID 992.
Option 4 - Use an attribute column to specify the colors when creating the graph without using Session Commands.
Suppose you want to use the Colors column to indicate the color of each bar. Minitab will assign colors to the groups.
1. Choose Graph > Bar Chart
2. From the Bars represent drop-down menu, choose Values from a table.
3. Under One column of values, choose Cluster. Click OK.
4. In Graph variables, enter Data and in Categorical variables for grouping, enter Year Quarter Colors.
5. Click Data View.
6. In Categorical variable for attribute assignment, enter Colors.
7. Click OK in each dialog box.
Note: To change the default color for the bars of a cluster, follow the steps in Option 1.
8. Double-click the x-axis of the bar chart. On the Scale tab, in the Space Between Scale Categories uncheck the Auto box for Gap within clusters and write -1 in the field. Uncheck the Auto box for Gap between clusters and write 0 in the field.
9. Click the Show tab. In Show Labels By Scale Level uncheck Tick Labels for Colors. Click OK.