Section 6: Configuring a Grouped/Stacked Bar Chart

NOTE: In NetCharts 4.6 we introduced a new feature with bar charts that allows you view your data in both groups and stacks. This is a very powerful feature that gives you another dimension in visualizing your data.

When Completed

Your NetCharts Designer perspective will appear like this:
 
bar

Getting Started

Start by closing any open editors. Go to NetCharts Designer’s File menu and select the Close All option.
 
Next, create a new project named GroupStackBarProject.

Create Data Set

Bring up the Named Data Set (NDS) wizard by clicking on the NDS icon. Set the Named Data Set Name to bardata and select the Hypersonic SQL option.
 
Select Next. Click the ellipsis button, and type in the following query into the SQL field:

SELECT LOCATION,COSTTYPE,ALLACTUAL,ALLBUDGET, Caffeinated FROM PRODUCTIONCOSTS WHERE LOCATION !=’All’ AND COSTTYPE != ‘All’ AND Caffeinated=’Caffeinated’

Create the Bar Chart

Select the New Chart wizard icon from the tool bar. After the chart wizard appears, type in barchartas the Chart Name, and select Bar as the type.
 
bar
 
Click Finish.
 
Under the Bar Chart tree node, in the General group, select moonlake from the Default Colors drop down menu.
 
If you are going to create a Group/Stack bar chart, before you start to bind data to the chart you need to change the Bar Sets Type. Select the Bars tree control and in the Bar Sets group, change the Bar Sets Type menu to Group/Stack. Now you can bind the data to the chart.
 
Click on the Data Source Binding tab and select the Bar Values tree control. Choose bardata.ndx for the Data Source. Change the menu on the first column to Bar Set Name, the second column to Bar Set Group, and the third and fourth columns to Bar Set. Click on Select Rows to select all of the rows except Row 0.
 
bar
 
Select Bar Labels from the tree control. Choose bardata.ndx for the Data Source. Change the menu over the first column to Bar LabelsCheck the box next to Row 1, Row 5, Row 9, and Row 13.
 
bar
 
Select Bar Group Stack Labels from the tree control. Choose bardata.ndx for the Data Source. Change the menu over the third and fourth columns to Group Stack LabelsCheck the box next to Row 0 and make sure that Process Row‐Major is checked.
 
bar
 
Select Legend Items from the tree control. Choose bardata.ndx for the Data Source. Change the menu over the second column to Legend ItemsCheck the box next to Row 1, Row 2, Row 3, Row 4 and uncheck Process Row‐Major.

Additional Style

In the Presentation tab under the Bar Chart tree control change the Width to 600 and the Height to 250. In the Legend Groupcheck the Show Legend checkbox, and change the Location for the Legend to Bottom and its Layout to Horizontal. Add gridlines by selecting Grids tree node, clicking the New Grid button, and choosing basicgrid from the GridStyle drop down menu. Expand the Axes tree control and choose Left Axes. Set the Number Format to dollars.
 
bar