How to Use the Bar Chart


  1. In the Filters panel, click and hold the left mouse button on the filter representing the column you want to color by.

    Comment: Coloring is also available in the Visualization Properties dialog. The color of marked items is changed under Edit > Document Properties.

  2. Drag the filter to the center of the visualization.

    Response: Drop targets appear in the middle of the visualization.

  3. Release the mouse button on the Color target.

    Response: The bars are colored with one color for each category in the selected column.

    Comment: To learn more about coloring in Spotfire, see Coloring Overview.

  1. Right-click in the visualization to display the pop-up menu.

  2. Select Properties.

  3. Go to the Appearance page.

  4. Select the Sort bars by value check box.

    Response: The bars are sorted according to the summarized value for each bar.

    Comment: Go to the Category Axis page in the Visualization Properties dialog and select Reverse scale if you want the reversed order of the bars.

  1. Right-click in the bar chart to display the pop-up menu.

  2. Select Vertical Bars or Horizontal Bars depending on the current orientation of the bars.

    Response: The orientation of the bars is now changed according to your selection.

  1. Click on the axis selector on the value axis. This is where it says Sum([Column Name]), Count(...), or similarly.

    Response: A drop-down menu appears.

  2. Select Aggregation > and a new aggregation measure from the submenu.

    Comment: You can also right-click on the axis selector and select Custom Expression... from the menu to create your own expression.

    Response: The bar chart is updated to show the new information.

If you have a column containing values that can be interpreted as continuous values, such as an "Age" column, but you want to display bars for a number of age groups instead, you can use the auto-binning function.

  1. Put the desired continuous column on the category axis.

  2. Right-click on the column selector and select Auto-bin Column from the pop-up menu.

    Response: Spotfire automatically creates a number of bins in which the values are placed.

  3. If desired, use the binning slider to change the number of bins used in the visualization.

    Comment: You can also right-click on the column selector and select Number of Bins... to enter an exact number of bins on the category axis.

This is an example of how to use two columns on the value axis. Each column will be represented by a bar.

  1. Click on the arrow next to the plus sign on the value axis.

  2. Select a new column from the menu.
    Comment: A column can also be dragged and dropped from the filters panel.

  3. Select (Column Names) in the category axis column selector.
    Response: The two bars appear on the category axis.
    Comment: For more information on (Column Names), see the Non-Column Selections page.

This is an example of how you can split the bars in a visualization to display side-by-side bars instead of stacked bars.

  1. Create a bar chart with one numerical column on the value axis (e.g., Sales), one categorical column on the category axis (e.g., Year), and one categorical column to color by (e.g., Category).

    Response: A stacked bar chart with the sum of the numerical column (Sales) per category axis category (Year) is displayed.

  2. Right-click and select Side-by-Side Bars from the pop-up menu.

  3. Response: Each color category is now presented as a separate bar.
    Comment: You could also have kept the Stacked bars option and added the color category column to the category axis instead, in order to produce a similar result.

This is an example of how you can present all stacked bars as 100% high and show the segments in each bar as a percentage of the entire bar.

  1. Create a bar chart with one numerical column on the value axis (e.g., Sales), one categorical column on the category axis (e.g., Year), and one categorical column to color by (e.g., Category).

    Response: A stacked bar chart with the sum of the numerical column (Sales) per category axis category (Year) is displayed.

  2. Right-click and select 100% Stacked Bars from the pop-up menu.

    Response: All bars are now 100% and the percentage of each segment can be shown in a tooltip by hovering with the mouse pointer over the segment.
    Comment: You can also display the segment values or percentage by adjusting the Labels settings in the Visualization Properties dialog.

  1. Right-click on the visualization to display the pop-up menu.

  2. Select Properties.

  3. Go to the Lines & Curves page.

  4. Select the check box for any of the default lines or click on Add to define a new horizontal or vertical line.

    Comment: You can only add lines to the category axis when it is in continuous mode. Right-click on the scale labels and select Continuous Scale from the pop-up menu.

  1. Right-click on the visualization to display the pop-up menu.

  2. Select Properties.

  3. Go to the Lines & Curves page.

  4. Click on Add and select a suitable curve fit from the drop-down menu.

    Comment: You can select from a number of predefined curve fits, or define your own curve using Curve Draw. See Curve Fit Models for more information about the different options.

  5. Once the curve has been created, you can change its settings on the Lines & Curves page. Some of the curve settings are also available from the pop-up menu in the visualization.

  1. Right-click on the value axis and select Multiple Scales from the pop-up menu.

    Comment: By default, you will get one scale for each color that is defined under Color By.

  2. You can also go to the Value Axis page in the Visualization Properties dialog and click the Multiple scales radio button. This is also where you can change the settings for the different scales as well as define which side of the bar chart a certain scale should be located.

    Comment: If you are using values from different columns on the various scales, you can also use drag and drop to move columns from one side to another.

  1. Right-click in the visualization to display the pop-up menu.

  2. Select Properties.

  3. Go to the Error Bars page.

  4. In the Visible error bars list, select the column or measure to use, and select the check box next to it.

    Response: The settings for the selected column or measure will be displayed in the lower part of the dialog.

    Comment: Only columns and measures with numerical values are listed.

  5. To define an upper error, choose a column or measure in the Upper error column selector. To define a lower error, choose a column or measure in the Lower error column selector.

    Response: The defined error bars appear in the visualization. See the Error Bars page in the Bar Chart Properties for more information about the settings. To learn more about error bars in general, see Error Bars.

    Note: Make sure the bar chart is displayed using the layout option Side-by-side bars. Error bars cannot be displayed in bar charts with percentage scaling, that is, with Stacked bars and 100% stacked bars. Open the Appearance page in the Bar Chart Properties dialog if you need to change the bar chart layout.

  6. To create a new bar chart:

  1. Click on the New Bar Chart button on the toolbar, bar_new_bar_chart_button.png.

    Comment: You can also select Insert > New Visualization > Bar Chart from the menu.

    Response: A first attempt to set up a suitable bar chart is made by the application.

  2. Adjust the bar chart to display the categories and measures of your choice.

    Comment: For more information about how to change what to show on the two axes, see Column Selectors.

See also:

Bar Chart Properties

What is a Bar Chart?