Skip to main content Skip to complementary content

Creating bar charts

The bar chart is suitable for comparing multiple values. The dimension axis shows the category items that are compared, and the measure axis shows the value for each category item.

You can create a bar chart on the sheet you are editing.

  1. In a sheet, click to add a new visualization.
  2. Under Visualization, select one of the following kinds of bar charts:
    • Vertical grouped bar chart
    • Horizontal grouped bar chart
    • Vertical stacked bar chart
    • Horizontal stacked bar chart
  3. Click and drag a field or master item under data as a dimension.
  4. Click and drag a field or master item under data as a measure.

In a bar chart you need at least one measure.

You can include up to two dimensions and one measure, or one dimension and up to 15 measures in a bar chart. Each bar corresponds to a dimension, and the values of the measures determine the height or length of the bars.

You can also create a bar chart with no dimension and up to 15 measures. In this case, one bar is displayed for every measure. The value of the measure determines the height or length of a bar.

Creating a bar chart
Dimensions Measures Result
1 dimension 1 measure A simple bar chart with one bar for each dimension value.
2 dimensions 1 measure A grouped or a stacked bar chart with one bar for each value of the two dimensions.
No dimension up to 15 measures A simple bar chart with one bar for each measure.
1 dimension up to 15 measures A grouped or a stacked bar chart with one bar for each value of each measure.

When you have created the bar chart, you might want to adjust its presentation in standard edit mode. For more information, see Presentation properties.

You can also change the chart's appearance in the advanced edit mode. For information about styling see Styling the bar chart. For information about customizing other aspects of the chart's appearance, see Changing the appearance of a visualization.

Styling the bar chart

With Advanced options turned on, you have a number of styling options available under Appearance in the properties panel.

Click Styling under Appearance > Presentation to further customize the styling of the chart. The styling panel contains various sections under the General and Chart tabs.

You can reset your styles by clicking next to each section. Clicking Reset all resets styles for all available tabs in the styling panel.

For general information about styling an individual visualization, see Applying custom styling to a visualization.

Customizing the text

You can set the text for the title, subtitle, and footnote under Appearance > General. To hide these elements, turn off Show titles.

The visibility of the different labels on the chart depends on chart-specific settings and label display options. These can be configured in the properties panel.

You can style the text that appears in the chart.

  1. Click Advanced options.

  2. In the properties panel, expand the Appearance section.

  3. Under AppearancePresentation, click Styling.

  4. On the General tab, set the font, emphasis style, font size, and color for the following text elements:

    • Title

    • Subtitle

    • Footnote

  5. On the Chart tab, set the font, font size, and color for the following text elements:

    • Axis title: Style the titles on the axes.

    • Axis label: Style the labels on the axes.

    • Value labels: Style the labels which display the measure value for each dimension value.

      When using the Stacked presentation option, this setting controls Segment labels (measure values for each dimension value) and Total labels (combines the measure values for each dimension value).

    • Legend title: Style the title of the legend.

    • Legend labels: Style the labels of the individual legend items.

Customizing the background

You can customize the background of the chart. The background can be set by color and image.

  1. Click Advanced options.

  2. In the properties panel, expand the Appearance section.

  3. Under AppearancePresentation, click Styling.

  4. On the General tab of the styling panel, you can select a background color (single color or expression). You can also set the background to an image from your media library or from a URL.

    Information note

    To add a background image from a URL, the URL's origin needs to be added to the allowlist in your tenant's Content Security Policy. The origin must be added with the following Directive: img-src. This is done by a tenant administrator.

    For more information, see Creating a CSP entry.

    When using a background color, use the slider to adjust the opacity of the background.

    When using a background image, you can adjust image sizing and position.

Customizing the bar segment outline and bar width

You can adjust the outline surrounding each bar segment in the chart, as well as the width of the bars.

  1. Click Advanced options.

  2. In the properties panel, expand the Appearance section.

  3. Under AppearancePresentation, click Styling.

  4. On the Chart tab of the styling panel, under Outline, set the thickness and color of the outlines.

  5. Adjust the slider for Bar width to set the width of the bars.

Customizing the border and shadow

You can customize the border and shadow of the chart.

  1. Click Advanced options.

  2. In the properties panel, expand the Appearance section.

  3. Under AppearancePresentation, click Styling.

  4. On the General tab of the styling panel, under Border, adjust the Outline size to increase or decrease the border lines around the chart.

  5. Select a color for the border.

  6. Adjust the Corner radius to control the roundness of the border.

  7. Under Shadow in the General tab, select a shadow size and color. Select None to remove the shadow.

Adding trend lines

You can add trend lines to the chart. Use trend lines to visualize how data changes over time.

For more information about trend lines, see Trend lines.

  1. In sheet edit mode, click Advanced options.

  2. In the properties panel, expand the Data section.

  3. Under Measures, expand the measure for which you are adding trend lines.

  4. Under Trend lines, click Add trend line.

  5. Define the Label and Type for the trend line.

  6. Use the Colors slider to define Custom or Auto coloring.

  7. Use the checkbox to toggle a Dashed appearance on or off.

Showing or hiding dimensions and measures depending on a condition

You can show or hide a dimension or measure depending on if a condition is true or false. This is known as a show condition, and is entered as an expression. The dimension or measure is only shown if the expression is evaluated as true. If this field is empty, the dimension or measure is always shown. Expand the dimension or measure in the Data section of the properties panel and enter an expression under Show dimension if or Show measure if.

Information note

Custom tooltips are disabled for a bar chart if any of the dimensions in the chart are using a show condition.

Let's say you have a dataset with the fields City, Manager, and Sales, among others. You could configure your bar chart so that aggregated sales are displayed along a dimension called City. You can add a second dimension, Manager, but only organize the data by this dimension if there are more than three manager names associated with your sales data.

  1. In edit mode, turn on the advanced options.

  2. Drag a bar chart from the assets panel onto the sheet.

  3. Add City as a dimension.

  4. Add Manager as a second dimension from the properties panel.

  5. Add Sum(Sales) as a measure.

  6. In the properties panel, expand the dimension Manager. Under Show dimension if, add the following expression:

    Count(distinct Manager)>3

If your data only contains two manager names, the bar chart will not organize sales by manager, since the expression is evaluated as false. If the data contains three or more unique Manager values, sales will be organized by both City and Manager.

Related learning:

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!